From: gfx Date: Wed, 7 Oct 2009 12:00:57 +0000 (+0900) Subject: Implement 'does' attribute in has() X-Git-Tag: 0.37_03~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f74c4013f93b795e432e1818c3ebf13f5afb9f0;p=gitmo%2FMouse.git Implement 'does' attribute in has() --- diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index 49840b3..211cd52 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -80,8 +80,7 @@ sub _process_options{ $args->{type_constraint} = Mouse::Util::TypeConstraints::find_or_create_isa_type_constraint($args->{isa}); } elsif(exists $args->{does}){ - # TODO - # $args->{type_constraint} = Mouse::Util::TypeConstraints::find_or_create_does_type_constraint($args->{does}); + $args->{type_constraint} = Mouse::Util::TypeConstraints::find_or_create_does_type_constraint($args->{does}); } $tc = $args->{type_constraint}; diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index cee7f5e..c84c75c 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -398,7 +398,7 @@ sub find_or_parse_type_constraint { } sub find_or_create_does_type_constraint{ - my $type = find_or_parse_type_constriant(@_) || role_type(@_); + my $type = find_or_parse_type_constraint(@_) || role_type(@_); if($type->{type} && $type->{type} ne 'Role'){ Carp::cluck("$type is not a role type");