more refactoring to the Structured Role, put together some tests to show the optional...
[gitmo/MooseX-Types-Structured.git] / lib / MooseX / Meta / TypeConstraint / Structured / Named.pm
index 9934236..8c0b1d2 100644 (file)
@@ -2,7 +2,6 @@ package MooseX::Meta::TypeConstraint::Structured::Named;
 
 use Moose;
 use Moose::Meta::TypeConstraint ();
-use Moose::Util::TypeConstraints;
 
 extends 'Moose::Meta::TypeConstraint';
 with 'MooseX::Meta::TypeConstraint::Role::Structured';
@@ -11,14 +10,6 @@ with 'MooseX::Meta::TypeConstraint::Role::Structured';
 
 MooseX::Meta::TypeConstraint::Structured::Named - Structured Type Constraints
 
-=head1 VERSION
-
-0.01
-
-=cut
-
-our $VERSION = '0.01';
-
 =head1 DESCRIPTION
 
 Structured type constraints let you assign an internal pattern of type
@@ -35,18 +26,6 @@ against this signature pattern.
 Named structured Constraints expect the internal constraints to be in keys or
 fields similar to what we expect in a HashRef.
 
-=head1 TYPES
-
-The following types are defined in this class.
-
-=head2 Moose::Meta::TypeConstraint
-
-Used to make sure we can properly validate incoming signatures.
-
-=cut
-
-class_type 'Moose::Meta::TypeConstraint';
-
 =head1 ATTRIBUTES
 
 This class defines the following attributes.
@@ -155,27 +134,7 @@ sub signature_equals {
     return 1;
 }
 
-=head2 equals
-
-modifier to make sure equals descends into the L</signature>
-
-=cut
 
-around 'equals' => sub {
-    my ($equals, $self, $compared_type_constraint) = @_;
-    
-    ## Make sure we are comparing typeconstraints of the same base class
-    return unless $compared_type_constraint->isa(__PACKAGE__);
-    
-    ## Make sure the base equals is also good
-    return unless $self->$equals($compared_type_constraint);
-    
-    ## Make sure the signatures match
-    return unless $self->signature_equals($compared_type_constraint);
-   
-    ## If we get this far, the two are equal
-    return 1;
-};
 
 =head1 AUTHOR