X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute.pm;h=d83516834ac67689ae3319319107da0aa5d3134b;hb=a532c4ac93ebdcbd09cd455dbb49caf8a7de1912;hp=2e61cdbfc28341592c78a04312899d8fcc11e1ab;hpb=59f5bbde66d61d15b684be88d138fd798ba851d0;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 2e61cdb..d835168 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -7,7 +7,7 @@ use warnings; use Scalar::Util 'blessed', 'weaken'; use overload (); -our $VERSION = '0.64'; +our $VERSION = '0.71_01'; our $AUTHORITY = 'cpan:STEVAN'; use Moose::Meta::Method::Accessor; @@ -509,7 +509,7 @@ sub set_value { } if ($self->has_trigger) { - $self->trigger->($instance, $value, $self); + $self->trigger->($instance, $value); } } @@ -705,6 +705,8 @@ sub _get_delegate_method_list { } } +sub delegation_metaclass { 'Moose::Meta::Method::Delegation' } + sub _make_delegation_method { my ( $self, $handle_name, $method_to_call ) = @_; @@ -713,7 +715,7 @@ sub _make_delegation_method { $method_body = $method_to_call if 'CODE' eq ref($method_to_call); - return Moose::Meta::Method::Delegation->new( + return $self->delegation_metaclass->new( name => $handle_name, package_name => $self->associated_class->name, attribute => $self, @@ -787,16 +789,18 @@ will behave just as L does. =item B +=item B + =item B =item B - eval { $point->meta->get_attribute('x')->set_value($point, 'fourty-two') }; + eval { $point->meta->get_attribute('x')->set_value($point, 'forty-two') }; if($@) { print "Oops: $@\n"; } -I +I Before setting the value, a check is made on the type constraint of the attribute, if it has one, to see if the value passes it. If the @@ -964,7 +968,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006-2008 by Infinity Interactive, Inc. +Copyright 2006-2009 by Infinity Interactive, Inc. L