summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-06-08 13:40:39 +0200
committerfranck cuny <franck@lumberjaph.net>2010-06-08 13:42:05 +0200
commit5766c0f454cff8c3be1e4ac02dd545074084f5b2 (patch)
treedb5c610ba9550078d3b6f600a18fbd4dc3120bd1
parentadd documentation to method (diff)
downloadmoosex-net-api-5766c0f454cff8c3be1e4ac02dd545074084f5b2.tar.gz
fix methods name
-rw-r--r--lib/MooseX/Net/API/Meta/Method/APIMethod.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/MooseX/Net/API/Meta/Method/APIMethod.pm b/lib/MooseX/Net/API/Meta/Method/APIMethod.pm
index f1e4ff2..0ddcacd 100644
--- a/lib/MooseX/Net/API/Meta/Method/APIMethod.pm
+++ b/lib/MooseX/Net/API/Meta/Method/APIMethod.pm
@@ -23,26 +23,27 @@ has local_net_api_methods => (
 
 sub find_net_api_method_by_name {
     my ($meta, $name) = @_;
-    my $method_name = $meta->_find_net_api_method_by_name(sub{/^$name$/});
+    my $method_name = $meta->_find_net_api_method_by_name(sub {/^$name$/});
     return unless $method_name;
     my $method = $meta->find_method_by_name($method_name);
     if ($method->isa('Class::MOP::Method::Wrapped')) {
         return $method->get_original_method;
-    }else{
+    }
+    else {
         return $method;
     }
 }
 
 sub remove_net_api_method {
     my ($meta, $name) = @_;
-    my @methods = grep { !/$name/ } $meta->get_all_api_methods;
-    $meta->local_api_methods(\@methods);
+    my @methods = grep { !/$name/ } $meta->get_all_net_api_methods;
+    $meta->local_net_api_methods(\@methods);
     $meta->remove_method($name);
 }
 
 before add_net_api_method => sub {
     my ($meta, $name) = @_;
-    if ($meta->find_net_api_method_by_name(sub {/^$name$/})) {
+    if ($meta->_find_net_api_method_by_name(sub {/^$name$/})) {
         die MooseX::Net::API::Error->new(
             reason => "method '$name' is already declared in " . $meta->name);
     }