X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=0f0d088391ff7a9d0036df6d90470f571d6ccd25;hp=3ea2ca78e85c4bdc23d14856531c2c62eabec515;hb=80efe91126e926233fade8bdd58288929286fc09;hpb=060f922893d1a0308a393260b65ec172dca9dfe2 diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index 3ea2ca7..0f0d088 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -5,9 +5,6 @@ use Carp (); use Mouse::Meta::TypeConstraint; -#use Mouse::Meta::Method::Accessor; -use Mouse::Meta::Method::Delegation; - sub _process_options{ my($class, $name, $args) = @_; @@ -326,13 +323,11 @@ sub _get_accessor_method_ref { sub get_read_method_ref{ my($self) = @_; - return $self->{_read_method_ref} ||= $self->_get_accessor_method_ref('get_read_method', '_generate_reader'); } sub get_write_method_ref{ my($self) = @_; - return $self->{_write_method_ref} ||= $self->_get_accessor_method_ref('get_write_method', '_generate_writer'); } @@ -417,6 +412,8 @@ sub install_accessors{ my %handles = $attribute->_canonicalize_handles($attribute->{handles}); my $reader = $attribute->get_read_method_ref; + Mouse::Util::load_class($delegation_class); + while(my($handle_name, $method_to_call) = each %handles){ my $code = $delegation_class->_generate_delegation($attribute, $metaclass, $reader, $handle_name, $method_to_call);