X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=382763605db3f38328e7c52bd96ec1ea813f85ce;hp=ab75b2b5048473f655b8f113a5a3c75209a7f245;hb=b06ce1f502945c13a52c503f1a651fe92c91c773;hpb=0126c27c413cb63f67e66e09b0fdfeb92117503a diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index ab75b2b..3827636 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -38,11 +38,16 @@ sub create_anon_class{ return $self->create(undef, @_); } -sub is_anon_class{ - return exists $_[0]->{anon_serial_id}; -} +sub is_anon_class; + +sub roles; -sub roles { $_[0]->{roles} } +sub calculate_all_roles { + my $self = shift; + my %seen; + return grep { !$seen{ $_->name }++ } + map { $_->calculate_all_roles } @{ $self->roles }; +} sub superclasses { my $self = shift; @@ -166,7 +171,7 @@ sub get_all_attributes { return @attr; } -sub linearized_isa { @{ get_linear_isa($_[0]->name) } } +sub linearized_isa; sub new_object { my $self = shift; @@ -188,7 +193,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; @@ -206,7 +211,7 @@ sub _initialize_object{ : ref($default) eq 'CODE' ? $object->$default() : $default; - $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; @@ -472,6 +477,10 @@ __END__ Mouse::Meta::Class - The Mouse class metaclass +=head1 VERSION + +This document describes Mouse version 0.40_01 + =head1 METHODS =head2 C<< initialize(ClassName) -> Mouse::Meta::Class >>