summary refs log tree commit diff
path: root/lib/Net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/HTTP/Spore.pm7
-rw-r--r--lib/Net/HTTP/Spore/Meta/Method.pm3
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/Net/HTTP/Spore.pm b/lib/Net/HTTP/Spore.pm
index 5c4f0c7..38ba4f7 100644
--- a/lib/Net/HTTP/Spore.pm
+++ b/lib/Net/HTTP/Spore.pm
@@ -12,8 +12,6 @@ use Scalar::Util;
 
 use Net::HTTP::Spore::Core;
 
-our $VERSION = 0.03;
-
 # XXX should we let the possibility to override this super class, or add
 # another superclasses?
 
@@ -153,6 +151,9 @@ sub _add_methods {
 
     my $client = Net::HTTP::Spore->new_from_spec('twitter.json');
 
+    # from JSON specification string
+    my $client = Net::HTTP::Spore->new_from_string($json);
+
     # for identica
     my $client = Net::HTTP::Spore->new_from_spec('twitter.json', base_url => 'http://identi.ca/com/api');
 
@@ -204,7 +205,7 @@ either be a file on disk or a remote URL.
 =item new_from_string($specification_string, %args)
 
 Create and return a L<Net::HTTP::Spore::Core> object, with methods
-generated from the specification string.
+generated from a JSON specification string.
 
 =back
 
diff --git a/lib/Net/HTTP/Spore/Meta/Method.pm b/lib/Net/HTTP/Spore/Meta/Method.pm
index 9f95c48..1a04eca 100644
--- a/lib/Net/HTTP/Spore/Meta/Method.pm
+++ b/lib/Net/HTTP/Spore/Meta/Method.pm
@@ -133,10 +133,11 @@ has documentation => (
 sub wrap {
     my ( $class, %args ) = @_;
 
+    my $name = $args{name};
     my $code = sub {
         my ( $self, %method_args ) = @_;
 
-        my $method = $self->meta->find_spore_method_by_name( $args{name} );
+        my $method = $self->meta->find_spore_method_by_name( $name );
 
         my $payload =
           ( defined $method_args{spore_payload} )