2 package Class::MOP::Method::Generated;
10 our $AUTHORITY = 'cpan:STEVAN';
12 use base 'Class::MOP::Method';
18 ($options{package_name} && $options{name})
19 || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT";
21 my $self = $class->_new(%options);
23 $self->initialize_body;
29 my ( $class, %options ) = @_;
31 $options{is_inline} ||= 0;
32 $options{body} ||= undef;
34 bless \%options, $class;
39 sub is_inline { (shift)->{'is_inline'} }
42 confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class";
55 Class::MOP::Method::Generated - Abstract base class for generated methods
59 This is a C<Class::MOP::Method> subclass which is used interally
60 by C<Class::MOP::Method::Accessor> and C<Class::MOP::Method::Constructor>.
66 =item B<new (%options)>
68 This creates the method based on the criteria in C<%options>,
75 This is a boolean to indicate if the method should be generated
76 as a closure, or as a more optimized inline version.
82 This returns the boolean which was passed into C<new>.
84 =item B<initialize_body>
86 This is an abstract method and will throw an exception if called.
92 Stevan Little E<lt>stevan@iinteractive.comE<gt>
94 =head1 COPYRIGHT AND LICENSE
96 Copyright 2006-2008 by Infinity Interactive, Inc.
98 L<http://www.iinteractive.com>
100 This library is free software; you can redistribute it and/or modify
101 it under the same terms as Perl itself.