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.56';
+$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
use base 'Moose::Meta::Role';
# and the name is created from the
# roles if one has not been provided
$params{name} ||= (join "|" => map { $_->name } @{$params{roles}});
- $class->meta->new_object(%params);
+ $class->_new(\%params);
}
# NOTE:
(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;
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
\ No newline at end of file
+=cut