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;
30 my $options = @_ == 1 ? $_[0] : {@_};
32 $options->{is_inline} ||= 0;
33 $options->{body} ||= undef;
35 bless $options, $class;
40 sub is_inline { (shift)->{'is_inline'} }
43 confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class";
56 Class::MOP::Method::Generated - Abstract base class for generated methods
60 This is a C<Class::MOP::Method> subclass which is used interally
61 by C<Class::MOP::Method::Accessor> and C<Class::MOP::Method::Constructor>.
67 =item B<new (%options)>
69 This creates the method based on the criteria in C<%options>,
76 This is a boolean to indicate if the method should be generated
77 as a closure, or as a more optimized inline version.
83 This returns the boolean which was passed into C<new>.
85 =item B<initialize_body>
87 This is an abstract method and will throw an exception if called.
93 Stevan Little E<lt>stevan@iinteractive.comE<gt>
95 =head1 COPYRIGHT AND LICENSE
97 Copyright 2006-2008 by Infinity Interactive, Inc.
99 L<http://www.iinteractive.com>
101 This library is free software; you can redistribute it and/or modify
102 it under the same terms as Perl itself.