From: Shawn M Moore Date: Tue, 25 Nov 2008 06:23:30 +0000 (+0000) Subject: Remove kludges previously required because we didn't have anonymous roles X-Git-Tag: 0.05~77 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7623a65e11d4190166bb8bc86efdc9c880c0c9f3;p=gitmo%2FMooseX-Role-Parameterized.git Remove kludges previously required because we didn't have anonymous roles --- diff --git a/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm b/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm index 56eae06..f9518f0 100644 --- a/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm +++ b/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm @@ -4,33 +4,10 @@ use Moose; extends 'Moose::Meta::Role'; has parameters => ( - is => 'rw', - isa => 'MooseX::Role::Parameterized::Parameters', - required => 1, + is => 'rw', + isa => 'MooseX::Role::Parameterized::Parameters', ); -# we override get_method_map because this is an anonymous role, there's no -# package to check -sub get_method_map { - my $self = shift; - - return $self->{'methods'} ||= {}; -} - -# we override add_method because we don't want to install methods added through -# this API; we just stick it in the method map -sub add_method { - my ($self, $method_name, $method) = @_; - (defined $method_name && $method_name) - || Moose->throw_error("You must define a method name"); - - if (!blessed($method)) { - Moose->throw_error("You must pass a blessed method to add_method"); - } - - $self->get_method_map->{$method_name} = $method; -} - __PACKAGE__->meta->make_immutable; no Moose;