X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FClass.pm;h=2951ead33af0f8fd255a9b0ba5b6661251723ff5;hb=e06951bb83e29645bd9186e3180a6af480929050;hp=c58539b31693b1109916d3d69211296a83b97a04;hpb=72643035d73124e0b4ef7a8335cdc4f793732b5a;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index c58539b..2951ead 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -12,7 +12,7 @@ use List::Util qw( first ); use List::MoreUtils qw( any all uniq first_index ); use Scalar::Util 'weaken', 'blessed'; -our $VERSION = '1.08'; +our $VERSION = '1.14'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -69,19 +69,6 @@ sub initialize { ); } -sub _immutable_options { - my ( $self, @args ) = @_; - - $self->SUPER::_immutable_options( - inline_destructor => 1, - - # Moose always does this when an attribute is created - inline_accessors => 0, - - @args, - ); -} - sub create { my ($class, $package_name, %options) = @_; @@ -407,7 +394,7 @@ sub _is_role_only_subclass { # loop over all methods that are a part of the current class # (not inherited) - for my $method (map { $meta->get_method($_) } $meta->get_method_list) { + for my $method ( $meta->_get_local_methods ) { # always ignore meta next if $method->name eq 'meta'; # we'll deal with attributes below @@ -653,6 +640,21 @@ sub _process_inherited_attribute { } } +## Immutability + +sub _immutable_options { + my ( $self, @args ) = @_; + + $self->SUPER::_immutable_options( + inline_destructor => 1, + + # Moose always does this when an attribute is created + inline_accessors => 0, + + @args, + ); +} + ## ------------------------------------------------- our $error_level; @@ -768,8 +770,8 @@ This overrides the parent's method to add a few options. Specifically, it uses the Moose-specific constructor and destructor classes, and enables inlining the destructor. -Also, since Moose always inlines attributes, it sets the -C option to false. +Since Moose always inlines attributes, it sets the C option +to false. =item B<< $metaclass->new_object(%params) >> @@ -840,8 +842,8 @@ be provided as a hash reference. =item B<< $metaclass->destructor_class($class_name) >> -These are the names of classes used when making a class -immutable. These default to L and +These are the names of classes used when making a class immutable. These +default to L and L respectively. These accessors are read-write, so you can use them to change the class name.