From: gfx Date: Sat, 3 Oct 2009 06:10:46 +0000 (+0900) Subject: Cleanup X-Git-Tag: 0.37_02~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=deb9a0f32002cd07012c50884a227335b93f1449 Cleanup --- diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index d356c74..9bc6e30 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -562,9 +562,9 @@ on success, otherwise Ces. Creates a new attribute in the owner class, inheriting options from parent classes. Accessors and helper methods are installed. Some error checking is done. -=item C<< get_read_method_ref >> +=head2 C<< get_read_method_ref >> -=item C<< get_write_method_ref >> +=head2 C<< get_write_method_ref >> Returns the subroutine reference of a method suitable for reading or writing the attribute's value in the associated class. These methods diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 85066c7..93c7874 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -11,7 +11,8 @@ use Mouse::Meta::Method::Destructor; use Mouse::Meta::Module; our @ISA = qw(Mouse::Meta::Module); -sub method_metaclass(){ 'Mouse::Meta::Method' } # required for get_method() +sub method_metaclass() { 'Mouse::Meta::Method' } +sub attribute_metaclass() { 'Mouse::Meta::Attribute' } sub _construct_meta { my($class, %args) = @_; @@ -114,7 +115,7 @@ sub add_attribute { $attr = $inherited_attr->clone_and_inherit_options($name, \%args); } else{ - my($attribute_class, @traits) = Mouse::Meta::Attribute->interpolate_class($name, \%args); + my($attribute_class, @traits) = $self->attribute_metaclass->interpolate_class($name, \%args); $args{traits} = \@traits if @traits; $attr = $attribute_class->new($name, %args); diff --git a/lib/Mouse/Meta/Module.pm b/lib/Mouse/Meta/Module.pm index 25831a9..07c6853 100755 --- a/lib/Mouse/Meta/Module.pm +++ b/lib/Mouse/Meta/Module.pm @@ -10,9 +10,7 @@ use Mouse::Util qw/:meta get_code_package not_supported load_class/; my %METAS; -# because Mouse doesn't introspect existing classes, we're forced to -# only pay attention to other Mouse classes -sub _metaclass_cache { +sub _metaclass_cache { # DEPRECATED my($class, $name) = @_; return $METAS{$name}; } @@ -63,7 +61,7 @@ sub name { $_[0]->{package} } # add_attribute is an abstract method -sub get_attribute_map { +sub get_attribute_map { # DEPRECATED Carp::cluck('get_attribute_map() has been deprecated'); return $_[0]->{attributes}; } diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index d8d9d82..1bf2f7d 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -37,7 +37,7 @@ our %EXPORT_TAGS = ( # aliases as public APIs -# it must be 'require', because Mouse::Meta::Module depends on Mouse::Util +# it must be 'require', not 'use', because Mouse::Meta::Module depends on Mouse::Util require Mouse::Meta::Module; # for the entities of metaclass cache utilities BEGIN { diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index 5b3130a..71a0c72 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -74,7 +74,7 @@ BEGIN { ); } - sub optimized_constraints { + sub optimized_constraints { # DEPRECATED Carp::cluck('optimized_constraints() has been deprecated'); return \%TYPE; } @@ -186,7 +186,7 @@ sub role_type { ); } -sub typecast_constraints { +sub typecast_constraints { # DEPRECATED my($class, $pkg, $type, $value) = @_; Carp::croak("wrong arguments count") unless @_ == 4;