Class::MOP::Method::Constructor.3pm

Langue: en

Version: 2008-02-08 (mandriva - 01/05/08)

Section: 3 (Bibliothèques de fonctions)

NAME

Class::MOP::Method::Constructor - Method Meta Object for constructors

SYNOPSIS

   use Class::MOP::Method::Constructor;
 
   my $constructor = Class::MOP::Method::Constructor->new(
       metaclass => $metaclass,
       options   => {
           debug => 1, # this is all for now
       },
   );
 
   # calling the constructor ...
   $constructor->body->($metaclass->name, %params);
 
 

DESCRIPTION

This is a subclass of "Class::MOP::Method" which deals with class constructors. This is used when making a class immutable to generate an optimized constructor.

METHODS

new (metaclass = $meta, options => \%options)>
options
This returns the options HASH which is passed into "new".
associated_metaclass
This returns the metaclass which is passed into "new".
attributes
This returns the list of attributes which are associated with the metaclass which is passed into "new".
meta_instance
This returns the meta instance which is associated with the metaclass which is passed into "new".
is_inline
This returns a boolean, but since constructors are very rarely not inlined, this always returns true for now.
initialize_body
This creates the code reference for the constructor itself.

Method Generators

generate_constructor_method
generate_constructor_method_inline

AUTHORS

Stevan Little <stevan@iinteractive.com> Copyright 2006-2008 by Infinity Interactive, Inc.

<http://www.iinteractive.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.