about summary refs log tree commit diff
path: root/lib/MooseX/Net/API/Meta/Method
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-06-04 17:27:23 +0200
committerfranck cuny <franck@lumberjaph.net>2010-06-04 17:27:23 +0200
commitb278d3a89da49ab9cd879a129e9734c19cdfee29 (patch)
treef4ec30901c3d5edb79d5ea0a7162d9a024797a91 /lib/MooseX/Net/API/Meta/Method
parentadd kwalitee (diff)
downloadnet-http-api-b278d3a89da49ab9cd879a129e9734c19cdfee29.tar.gz
remove method; pretty output
Diffstat (limited to 'lib/MooseX/Net/API/Meta/Method')
-rw-r--r--lib/MooseX/Net/API/Meta/Method/APIMethod.pm9
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