use warnings;
use metaclass;
-use Carp 'confess';
-use Scalar::Util 'blessed', 'reftype';
+use Carp 'confess';
+use Scalar::Util 'blessed';
-use Data::Dumper;
-
-our $VERSION = '0.01';
+our $VERSION = '0.50';
our $AUTHORITY = 'cpan:STEVAN';
use base 'Moose::Meta::Role';
(defined $method_name && $method_name)
|| confess "You must define a method name";
- my $body = (blessed($method) ? $method->body : $method);
- ('CODE' eq (reftype($body) || ''))
- || confess "Your code block must be a CODE reference";
+ # make sure to bless the
+ # method if nessecary
+ $method = $self->method_metaclass->wrap(
+ $method,
+ package_name => $self->name,
+ name => $method_name
+ ) if !blessed($method);
- $self->get_method_map->{$method_name} = $body;
+ $self->get_method_map->{$method_name} = $method;
}
1;
=head1 COPYRIGHT AND LICENSE
-Copyright 2006, 2007 by Infinity Interactive, Inc.
+Copyright 2006-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>