Moose::Meta::Class - The Moose metaclass |
Moose::Meta::Class - The Moose metaclass
version 2.1605
This class is a subclass of the Class::MOP::Class manpage that provides additional Moose-specific functionality.
To really understand this class, you will need to start with the the Class::MOP::Class manpage documentation. This class can be understood as a set of additional features on top of the basic feature provided by that parent class.
Moose::Meta::Class
is a subclass of the Class::MOP::Class manpage.
attribute_metaclass
, instance_metaclass
, and
method_metaclass
options.
These all default to the appropriate Moose class.
roles
option. This should be an array reference containing roles
that the class does, each optionally followed by a hashref of options
(-excludes
and -alias
).
my $metaclass = Moose::Meta::Class->create( 'New::Class', roles => [...] );
roles
option, just
as create
does.
It also accepts a cache
option. If this is true
, then the anonymous
class will be cached based on its superclasses and roles. If an
existing anonymous class in the cache has the same superclasses and
roles, it will be reused.
my $metaclass = Moose::Meta::Class->create_anon_class( superclasses => ['Foo'], roles => [qw/Some Roles Go Here/], cache => 1, );
Each entry in both the superclasses
and the roles
option can be
followed by a hash reference with arguments. The superclasses
option can be supplied with a -version option that ensures the loaded superclass satisfies the
required version. The role
option also takes the -version
as an
argument, but the option hash reference can also contain any other
role relevant values like exclusions or parameterized role arguments.
new_object(%params)
>>superclasses(@superclasses)
>>Each superclass can be followed by a hash reference containing a -version value. If the version requirement is not satisfied an error will be thrown.
When you pass classes to this method, we will attempt to load them if they are not already loaded.
override
method modifier to the package.
augment
method modifier to the package.
add_role($role)
>>add_role_application($application)
>>does_role($role)
>>excludes_role($role_name)
>>constructor_class($class_name)
>>destructor_class($class_name)
>>
See Moose/BUGS for details on reporting bugs.
This software is copyright (c) 2006 by Infinity Interactive, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Moose::Meta::Class - The Moose metaclass |