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;
foreach my $super(@_){
Mouse::Util::load_class($super);
my $meta = Mouse::Util::get_metaclass_by_name($super);
- if($meta && $meta->isa('Mouse::Meta::Role')){
+ if(Mouse::Util::is_a_metarole($meta)){
$self->throw_error("You cannot inherit from a Mouse Role ($super)");
}
}
my($self, $method_name) = @_;
defined($method_name)
or $self->throw_error('You must define a method name to find');
+
foreach my $class( $self->linearized_isa ){
my $method = $self->initialize($class)->get_method($method_name);
return $method if defined $method;
}
sub compute_all_applicable_attributes {
- Carp::cluck('compute_all_applicable_attributes() has been deprecated');
+ Carp::cluck('compute_all_applicable_attributes() has been deprecated')
+ if _MOUSE_VERBOSE;
return shift->get_all_attributes(@_)
}
return @attr;
}
-sub linearized_isa { @{ get_linear_isa($_[0]->name) } }
+sub linearized_isa;
sub new_object {
my $self = shift;
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;
: ref($default) eq 'CODE' ? $object->$default()
: $default;
- # XXX: we cannot use $attribute->set_value() because it invokes triggers.
- $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;
Mouse::Meta::Class - The Mouse class metaclass
+=head1 VERSION
+
+This document describes Mouse version 0.40_05
+
=head1 METHODS
=head2 C<< initialize(ClassName) -> Mouse::Meta::Class >>