diff options
author | franck cuny <franck@lumberjaph.net> | 2010-06-04 17:27:23 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-06-04 17:27:23 +0200 |
commit | b278d3a89da49ab9cd879a129e9734c19cdfee29 (patch) | |
tree | f4ec30901c3d5edb79d5ea0a7162d9a024797a91 /lib/MooseX/Net/API/Meta/Method | |
parent | add kwalitee (diff) | |
download | moosex-net-api-b278d3a89da49ab9cd879a129e9734c19cdfee29.tar.gz |
remove method; pretty output
Diffstat (limited to '')
-rw-r--r-- | lib/MooseX/Net/API/Meta/Method/APIMethod.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/MooseX/Net/API/Meta/Method/APIMethod.pm b/lib/MooseX/Net/API/Meta/Method/APIMethod.pm index 0f6a6e8..ac57edf 100644 --- a/lib/MooseX/Net/API/Meta/Method/APIMethod.pm +++ b/lib/MooseX/Net/API/Meta/Method/APIMethod.pm @@ -9,7 +9,7 @@ use MooseX::Types::Moose qw/Str ArrayRef/; has local_api_methods => ( traits => ['Array'], - is => 'ro', + is => 'rw', isa => ArrayRef [Str], required => 1, default => sub { [] }, @@ -60,6 +60,13 @@ after add_net_api_method => sub { ); }; +sub remove_net_api_method { + my ($meta, $name) = @_; + my @methods = grep { !/$name/ } $meta->get_all_api_methods; + $meta->local_api_methods(\@methods); + $meta->remove_method($name); +} + 1; =head1 SYNOPSIS |