.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Moose::Meta::Class 3pm" .TH Moose::Meta::Class 3pm "2012-06-28" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Moose::Meta::Class \- The Moose metaclass .SH "VERSION" .IX Header "VERSION" version 2.0603 .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class is a subclass of Class::MOP::Class that provides additional Moose-specific functionality. .PP To really understand this class, you will need to start with the Class::MOP::Class documentation. This class can be understood as a set of additional features on top of the basic feature provided by that parent class. .SH "INHERITANCE" .IX Header "INHERITANCE" \&\f(CW\*(C`Moose::Meta::Class\*(C'\fR is a subclass of Class::MOP::Class. .SH "METHODS" .IX Header "METHODS" .ie n .IP "\fBMoose::Meta::Class\->initialize($package_name, \fB%options\fB)\fR" 4 .el .IP "\fBMoose::Meta::Class\->initialize($package_name, \f(CB%options\fB)\fR" 4 .IX Item "Moose::Meta::Class->initialize($package_name, %options)" This overrides the parent's method in order to provide its own defaults for the \f(CW\*(C`attribute_metaclass\*(C'\fR, \f(CW\*(C`instance_metaclass\*(C'\fR, and \&\f(CW\*(C`method_metaclass\*(C'\fR options. .Sp These all default to the appropriate Moose class. .ie n .IP "\fBMoose::Meta::Class\->create($package_name, \fB%options\fB)\fR" 4 .el .IP "\fBMoose::Meta::Class\->create($package_name, \f(CB%options\fB)\fR" 4 .IX Item "Moose::Meta::Class->create($package_name, %options)" This overrides the parent's method in order to accept a \f(CW\*(C`roles\*(C'\fR option. This should be an array reference containing roles that the class does, each optionally followed by a hashref of options (\f(CW\*(C`\-excludes\*(C'\fR and \f(CW\*(C`\-alias\*(C'\fR). .Sp .Vb 1 \& my $metaclass = Moose::Meta::Class\->create( \*(AqNew::Class\*(Aq, roles => [...] ); .Ve .IP "\fBMoose::Meta::Class\->create_anon_class\fR" 4 .IX Item "Moose::Meta::Class->create_anon_class" This overrides the parent's method to accept a \f(CW\*(C`roles\*(C'\fR option, just as \f(CW\*(C`create\*(C'\fR does. .Sp It also accepts a \f(CW\*(C`cache\*(C'\fR 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. .Sp .Vb 5 \& my $metaclass = Moose::Meta::Class\->create_anon_class( \& superclasses => [\*(AqFoo\*(Aq], \& roles => [qw/Some Roles Go Here/], \& cache => 1, \& ); .Ve .Sp Each entry in both the \f(CW\*(C`superclasses\*(C'\fR and the \f(CW\*(C`roles\*(C'\fR option can be followed by a hash reference with arguments. The \f(CW\*(C`superclasses\*(C'\fR option can be supplied with a \-version option that ensures the loaded superclass satisfies the required version. The \f(CW\*(C`role\*(C'\fR option also takes the \f(CW\*(C`\-version\*(C'\fR as an argument, but the option hash reference can also contain any other role relevant values like exclusions or parameterized role arguments. .ie n .IP "\fB\fB$metaclass\fB\->new_object(%params)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->new_object(%params)\fR" 4 .IX Item "$metaclass->new_object(%params)" This overrides the parent's method in order to add support for attribute triggers. .ie n .IP "\fB\fB$metaclass\fB\->superclasses(@superclasses)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->superclasses(@superclasses)\fR" 4 .IX Item "$metaclass->superclasses(@superclasses)" This is the accessor allowing you to read or change the parents of the class. .Sp 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. .ie n .IP "\fB\fB$metaclass\fB\->add_override_method_modifier($name, \f(BI$sub\fB)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->add_override_method_modifier($name, \f(CB$sub\fB)\fR" 4 .IX Item "$metaclass->add_override_method_modifier($name, $sub)" This adds an \f(CW\*(C`override\*(C'\fR method modifier to the package. .ie n .IP "\fB\fB$metaclass\fB\->add_augment_method_modifier($name, \f(BI$sub\fB)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->add_augment_method_modifier($name, \f(CB$sub\fB)\fR" 4 .IX Item "$metaclass->add_augment_method_modifier($name, $sub)" This adds an \f(CW\*(C`augment\*(C'\fR method modifier to the package. .ie n .IP "\fB\fB$metaclass\fB\->calculate_all_roles\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->calculate_all_roles\fR" 4 .IX Item "$metaclass->calculate_all_roles" This will return a unique array of \f(CW\*(C`Moose::Meta::Role\*(C'\fR instances which are attached to this class. .ie n .IP "\fB\fB$metaclass\fB\->calculate_all_roles_with_inheritance\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->calculate_all_roles_with_inheritance\fR" 4 .IX Item "$metaclass->calculate_all_roles_with_inheritance" This will return a unique array of \f(CW\*(C`Moose::Meta::Role\*(C'\fR instances which are attached to this class, and each of this class's ancestors. .ie n .IP "\fB\fB$metaclass\fB\->add_role($role)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->add_role($role)\fR" 4 .IX Item "$metaclass->add_role($role)" This takes a Moose::Meta::Role object, and adds it to the class's list of roles. This \fIdoes not\fR actually apply the role to the class. .ie n .IP "\fB\fB$metaclass\fB\->role_applications\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->role_applications\fR" 4 .IX Item "$metaclass->role_applications" Returns a list of Moose::Meta::Role::Application::ToClass objects, which contain the arguments to role application. .ie n .IP "\fB\fB$metaclass\fB\->add_role_application($application)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->add_role_application($application)\fR" 4 .IX Item "$metaclass->add_role_application($application)" This takes a Moose::Meta::Role::Application::ToClass object, and adds it to the class's list of role applications. This \fIdoes not\fR actually apply any role to the class; it is only for tracking role applications. .ie n .IP "\fB\fB$metaclass\fB\->does_role($role)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->does_role($role)\fR" 4 .IX Item "$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 Moose::Meta::Role object. This tests both the class and its parents. .ie n .IP "\fB\fB$metaclass\fB\->excludes_role($role_name)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->excludes_role($role_name)\fR" 4 .IX Item "$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. .ie n .IP "\fB\fB$metaclass\fB\->add_attribute($attr_name, \f(BI%params\fB|$params)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->add_attribute($attr_name, \f(CB%params\fB|$params)\fR" 4 .IX Item "$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. .ie n .IP "\fB\fB$metaclass\fB\->constructor_class($class_name)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->constructor_class($class_name)\fR" 4 .IX Item "$metaclass->constructor_class($class_name)" .PD 0 .ie n .IP "\fB\fB$metaclass\fB\->destructor_class($class_name)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->destructor_class($class_name)\fR" 4 .IX Item "$metaclass->destructor_class($class_name)" .PD These are the names of classes used when making a class immutable. These default to Moose::Meta::Method::Constructor and Moose::Meta::Method::Destructor respectively. These accessors are read-write, so you can use them to change the class name. .ie n .IP "\fB\fB$metaclass\fB\->error_class($class_name)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->error_class($class_name)\fR" 4 .IX Item "$metaclass->error_class($class_name)" The name of the class used to throw errors. This defaults to Moose::Error::Default, which generates an error with a stacktrace just like \f(CW\*(C`Carp::confess\*(C'\fR. .ie n .IP "\fB\fB$metaclass\fB\->throw_error($message, \f(BI%extra\fB)\fR" 4 .el .IP "\fB\f(CB$metaclass\fB\->throw_error($message, \f(CB%extra\fB)\fR" 4 .IX Item "$metaclass->throw_error($message, %extra)" Throws the error created by \f(CW\*(C`create_error\*(C'\fR using \f(CW\*(C`raise_error\*(C'\fR .SH "BUGS" .IX Header "BUGS" See \*(L"\s-1BUGS\s0\*(R" in Moose for details on reporting bugs. .SH "AUTHOR" .IX Header "AUTHOR" Moose is maintained by the Moose Cabal, along with the help of many contributors. See \*(L"\s-1CABAL\s0\*(R" in Moose and \*(L"\s-1CONTRIBUTORS\s0\*(R" in Moose for details. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2012 by Infinity Interactive, Inc.. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.