13 $METACLASS_CACHE{$name} = $class->new(name => $name)
14 if !exists($METACLASS_CACHE{$name});
15 return $METACLASS_CACHE{$name};
23 $args{attributes} = {};
24 $args{superclasses} = do {
26 \@{ $args{name} . '::ISA' };
32 sub name { $_[0]->{name} }
38 Mouse::load_class($_) for @_;
39 @{ $self->{superclasses} } = @_;
42 @{ $self->{superclasses} };
49 $self->{'attributes'}{$attr->name} = $attr;
52 sub get_attribute_map { $_[0]->{attributes} }
53 sub get_attribute { $_[0]->{attributes}->{$_[1]} }
55 sub linearized_isa { @{ mro::get_linear_isa($_[0]->name) } }
63 Mouse::Class - hook into the Mouse MOP
67 =head2 initialize ClassName -> Mouse::Class
69 Finds or creates a Mouse::Class instance for the given ClassName. Only one
70 instance should exist for a given class.
72 =head2 new %args -> Mouse::Class
74 Creates a new Mouse::Class. Don't call this directly.
76 =head2 name -> ClassName
78 Returns the name of the owner class.
80 =head2 superclasses -> [ClassName]
82 Gets (or sets) the list of superclasses of the owner class.
84 =head2 add_attribute Mouse::Attribute
86 Begins keeping track of the existing L<Mouse::Attribute> for the owner class.
88 =head2 get_attribute_map -> { name => Mouse::Attribute }
90 Returns a mapping of attribute names to their corresponding
91 L<Mouse::Attribute> objects.
93 =head2 get_attribute Name -> Mouse::Attribute | undef
95 Returns the L<Mouse::Attribute> with the given name.
97 =head2 linearized_isa -> [ClassNames]
99 Returns the list of classes in method dispatch order, with duplicates removed.