From: Shawn M Moore Date: Sat, 30 May 2009 19:51:58 +0000 (-0400) Subject: Add get_values X-Git-Tag: 0.80~42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a0bfed95902cbe3dec51782514466cace3e1ce1;p=gitmo%2FMoose.git Add get_values --- diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index ccb939b..a168f90 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -102,6 +102,11 @@ foreach my $action ( keys %{$self->$attr_reader}; }) if exists $methods->{get_keys}; + $META->add_method($methods->{get_values} => sub { + my ($self) = @_; + values %{$self->$attr_reader}; + }) if exists $methods->{get_values}; + $META->add_method($methods->{get} => sub { my ($self, $name) = @_; $self->$attr_reader->{$name}