2 package MooseX::Role::Parameterized::Meta::Role::Parameterized;
4 extends 'Moose::Meta::Role';
8 isa => 'MooseX::Role::Parameterized::Parameters',
12 # we override get_method_map because this is an anonymous role, there's no
17 return $self->{'methods'} ||= {};
20 # we override add_method because we don't want to install methods added through
21 # this API; we just stick it in the method map
23 my ($self, $method_name, $method) = @_;
24 (defined $method_name && $method_name)
25 || Moose->throw_error("You must define a method name");
27 if (!blessed($method)) {
28 Moose->throw_error("You must pass a blessed method to add_method");
31 $self->get_method_map->{$method_name} = $method;
34 __PACKAGE__->meta->make_immutable;