2 package Class::MOP::Method::Generated;
9 our $VERSION = '0.64_01';
10 $VERSION = eval $VERSION;
11 our $AUTHORITY = 'cpan:STEVAN';
13 use base 'Class::MOP::Method';
19 ($options{package_name} && $options{name})
20 || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT";
22 my $self = $class->_new(\%options);
24 $self->initialize_body;
31 my $options = @_ == 1 ? $_[0] : {@_};
33 $options->{is_inline} ||= 0;
34 $options->{body} ||= undef;
36 bless $options, $class;
41 sub is_inline { (shift)->{'is_inline'} }
44 confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class";
57 Class::MOP::Method::Generated - Abstract base class for generated methods
61 This is a C<Class::MOP::Method> subclass which is used interally
62 by C<Class::MOP::Method::Accessor> and C<Class::MOP::Method::Constructor>.
68 =item B<new (%options)>
70 This creates the method based on the criteria in C<%options>,
77 This is a boolean to indicate if the method should be generated
78 as a closure, or as a more optimized inline version.
84 This returns the boolean which was passed into C<new>.
86 =item B<initialize_body>
88 This is an abstract method and will throw an exception if called.
94 Stevan Little E<lt>stevan@iinteractive.comE<gt>
96 =head1 COPYRIGHT AND LICENSE
98 Copyright 2006-2008 by Infinity Interactive, Inc.
100 L<http://www.iinteractive.com>
102 This library is free software; you can redistribute it and/or modify
103 it under the same terms as Perl itself.