Revision history for Perl extension Class-MOP.
+0.72
+ * Class::MOP::Method
+ - Add an "execute" method to invoke the body so
+ we can avoid using the coderef overload (Sartak)
+
0.71 Wed November 26, 2008
* Class::MOP::Class
* Class::MOP::Module
: $self->fully_qualified_name;
}
+sub execute {
+ my $self = shift;
+ $self->body->(@_);
+}
+
# NOTE:
# the Class::MOP bootstrap
# will create this for us
=back
+=head2 Miscellaneous
+
+=over 4
+
+=item B<execute>
+
+Executes the method. Be sure to pass in the instance, since the
+method expects it.
+
+=back
+
=head1 AUTHORS
Stevan Little E<lt>stevan@iinteractive.comE<gt>
BEGIN {
if ( eval 'use Sub::Name (); 1;' ) {
- plan tests => 65;
+ plan tests => 66;
}
else {
plan skip_all => 'These tests require Sub::Name';
ok($Foo->has_method('foo'), '... Foo->has_method(foo) (defined with Sub::Name)');
is($Foo->get_method('foo')->body, $foo, '... Foo->get_method(foo) == \&foo');
+is($Foo->get_method('foo')->execute, 'Foo::foo', '... _method_foo->execute returns "Foo::foo"');
is(Foo->foo(), 'Foo::foo', '... Foo->foo() returns "Foo::foo"');
# now check all our other items ...