From b278d3a89da49ab9cd879a129e9734c19cdfee29 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Fri, 4 Jun 2010 17:27:23 +0200 Subject: remove method; pretty output --- lib/MooseX/Net/API/Meta/Method/APIMethod.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/MooseX') 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 -- cgit 1.4.1