From c94d18646c9116502cfb212de1ab9f8df2377b90 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Thu, 3 Jun 2010 14:11:54 +0200 Subject: rename some methods --- lib/MooseX/Net/API/Meta/Method/APIMethod.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/MooseX/Net/API/Meta/Method/APIMethod.pm') diff --git a/lib/MooseX/Net/API/Meta/Method/APIMethod.pm b/lib/MooseX/Net/API/Meta/Method/APIMethod.pm index d55fe82..0da54b8 100644 --- a/lib/MooseX/Net/API/Meta/Method/APIMethod.pm +++ b/lib/MooseX/Net/API/Meta/Method/APIMethod.pm @@ -13,15 +13,15 @@ has local_api_methods => ( default => sub { [] }, auto_deref => 1, handles => { - _get_api_method => 'grep', - _add_api_method => 'push', - _all_api_methods => 'elements', + find_api_method_by_name => 'grep', + add_api_method => 'push', + get_all_api_methods => 'elements', }, ); before add_net_api_method => sub { my ($meta, $name) = @_; - if (my @method = $meta->_get_api_method(sub {/^$name$/})) { + if (my @method = $meta->find_api_method_by_name(sub {/^$name$/})) { die MooseX::Net::API::Error->new( reason => "method '$name' is already declared in " . $meta->name); } @@ -30,7 +30,8 @@ before add_net_api_method => sub { sub add_net_api_method { my ($meta, $name, %options) = @_; - # accept blessed method + # XXX accept blessed method + my $code = delete $options{code}; $meta->add_method( $name, @@ -41,7 +42,7 @@ sub add_net_api_method { %options ), ); - $meta->_add_api_method($name); + $meta->add_api_method($name); } after add_net_api_method => sub { -- cgit v1.2.3