Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Moose::Meta::Class

Name Moose::Meta::Class
Version 2.2201
Located at /usr/local/lib64/perl5
File /usr/local/lib64/perl5/Moose/Meta/Class.pm
Is Core No
Search CPAN for this module Moose::Meta::Class
Documentation Moose::Meta::Class
Module Details Moose::Meta::Class


NAME

Moose::Meta::Class - The Moose metaclass


VERSION

version 2.2201


DESCRIPTION

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.


INHERITANCE

Moose::Meta::Class is a subclass of the Class::MOP::Class manpage.


METHODS

Moose::Meta::Class->initialize($package_name, %options)
This overrides the parent's method in order to provide its own defaults for the attribute_metaclass, instance_metaclass, and method_metaclass options.

These all default to the appropriate Moose class.

Moose::Meta::Class->create($package_name, %options)
This overrides the parent's method in order to accept a 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 => [...] );

Moose::Meta::Class->create_anon_class
This overrides the parent's method to accept a 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.

$metaclass->new_object(%params)
This overrides the parent's method in order to add support for attribute triggers.

$metaclass->superclasses(@superclasses)
This is the accessor allowing you to read or change the parents of the class.

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.

$metaclass->add_override_method_modifier($name, $sub)
This adds an override method modifier to the package.

$metaclass->add_augment_method_modifier($name, $sub)
This adds an augment method modifier to the package.

$metaclass->calculate_all_roles
This will return a unique array of the Moose::Meta::Role manpage instances which are attached to this class.

$metaclass->calculate_all_roles_with_inheritance
This will return a unique array of the Moose::Meta::Role manpage instances which are attached to this class, and each of this class's ancestors.

$metaclass->add_role($role)
This takes a the Moose::Meta::Role manpage object, and adds it to the class's list of roles. This does not actually apply the role to the class.

$metaclass->role_applications
Returns a list of the Moose::Meta::Role::Application::ToClass manpage objects, which contain the arguments to role application.

$metaclass->add_role_application($application)
This takes a the Moose::Meta::Role::Application::ToClass manpage object, and adds it to the class's list of role applications. This does not actually apply any role to the class; it is only for tracking role applications.

$metaclass->does_role($role)
This returns a boolean indicating whether or not the class does the specified role. The role provided can be either a role name or a the Moose::Meta::Role manpage object. This tests both the class and its parents.

$metaclass->excludes_role($role_name)
A class excludes a role if it has already composed a role which excludes the named role. This tests both the class and its parents.

$metaclass->add_attribute($attr_name, %params|$params)
This overrides the parent's method in order to allow the parameters to be provided as a hash reference.

$metaclass->constructor_class($class_name)
$metaclass->destructor_class($class_name)
These are the names of classes used when making a class immutable. These default to the Moose::Meta::Method::Constructor manpage and the Moose::Meta::Method::Destructor manpage respectively. These accessors are read-write, so you can use them to change the class name.


BUGS

See Moose/BUGS for details on reporting bugs.


AUTHORS


COPYRIGHT AND LICENSE

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.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024