X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=563a208ef3217b9bff4b0e94481e6a2a8e21fb7c;hb=83fd4df5c46993d68fc0c2d84a1faffaef2b3cdd;hp=beaeee561fffc35b7022daaf7184b61db101c615;hpb=95ecd6f132112c6763cdaf2e6bc72c39e9ab76b5;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index beaeee5..563a208 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -65,6 +65,7 @@ sub find_method_by_name{ my($self, $method_name) = @_; defined($method_name) or $self->throw_error('You must define a method name to find'); + foreach my $class( $self->linearized_isa ){ my $method = $self->initialize($class)->get_method($method_name); return $method if defined $method; @@ -143,7 +144,8 @@ sub add_attribute { } sub compute_all_applicable_attributes { - Carp::cluck('compute_all_applicable_attributes() has been deprecated'); + Carp::cluck('compute_all_applicable_attributes() has been deprecated') + if _MOUSE_VERBOSE; return shift->get_all_attributes(@_) } @@ -186,7 +188,7 @@ sub _initialize_object{ my $key = $attribute->name; if (defined($from) && exists($args->{$from})) { - $object->{$key} = $attribute->_coerce_and_verify($args->{$from}); + $object->{$key} = $attribute->_coerce_and_verify($args->{$from}, $object); weaken($object->{$key}) if ref($object->{$key}) && $attribute->is_weak_ref; @@ -204,8 +206,7 @@ sub _initialize_object{ : ref($default) eq 'CODE' ? $object->$default() : $default; - # XXX: we cannot use $attribute->set_value() because it invokes triggers. - $object->{$key} = $attribute->_coerce_and_verify($value, $object);; + $object->{$key} = $attribute->_coerce_and_verify($value, $object); weaken($object->{$key}) if ref($object->{$key}) && $attribute->is_weak_ref;