MooseX::Interface::Internals - the classes and traits used under the hood of MooseX::Interface
This role is applied to your interface's metarole object. If you want to get to know the internals of MooseX::Interface, this is the place to start.
As well as providing the following methods, it also includes method modifiers for add_required_methods (to deal with method signatures) and apply (to trigger interface integrity checks).
add_required_methods
apply
is_interface
Boolean attribute.
test_cases
Arrayref of MooseX::Interface::Meta::TestCase objects.
integrity_checked
Boolean indicating whether the interface's integrity has been checked yet. An explicit one or __PACKAGE__->meta->check_interface_integrity will happily check the interface integrity every single time, but when a class implements an interface, we don't want to have to keep rechecking.
one
__PACKAGE__->meta->check_interface_integrity
installed_modifiers
Hashref of sub name to refaddr pairs of all "before" method modifiers that have been set up to implement required method signature checks.
add_constant($name, $value)
Define a constant.
add_test_case($coderef, $name)
add_test_case($blessed_testcase)
Accepts either a coderef+name pair, or a MooseX::Interface::Meta::TestCase object.
test_implementation($object)
Tests an instance of an implementation of the interface.
find_problematic_methods
Returns a list of Moose::Meta::Method objects judged to be problematic to the integrity of the interface.
find_problematic_method_modifiers
All method modifiers are problematic, except those that implement method signature checks.
check_interface_integrity
Calls find_problematic_methods and find_problematic_method_modifiers, and croaks if either of them return any problems.
Trivial subclass of Moose::Meta::Role::Method.
Trivial subclass of Moose::Meta::Role::Method::Required.
Subclass of Moose::Meta::Role::Method::Required.
signature
An arrayref of strings or Moose::Meta::TypeConstraint objects.
check_signature($arglist)
Given an arrayref of method arguments (not including the invocant), checks them against the signature. Returns false if the signature is violated.
Represents an embedded test case.
name
code
associated_interface
test_instance($instance)
Class with much overloading, returned by test_implementation.
test_implementation
TODO: these objects might want attributes to retrieve the object tested plus the interface metarole.
passed
Arrayref of passing test cases.
failed
Arrayref of failing test cases.
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=MooseX-Interface.
MooseX::Interface.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install MooseX::Interface, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Interface
CPAN shell
perl -MCPAN -e shell install MooseX::Interface
For more information on module installation, please visit the detailed CPAN module installation guide.