Changeset 2152

Show
Ignore:
Timestamp:
01/29/07 18:32:08
Author:
miyagawa
Message:

0.02: support camel case methods

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WebService-Lingr/trunk/Changes

    r2143 r2152  
    11Revision history for Perl extension WebService::Lingr 
     2 
     3  0.02  Mon Jan 29 01:28:52 PST 2007 
     4        - Fixed method mapping to support camelCase methods 
    25 
    36  0.01  Sun Jan 28 19:11:29 2007 
  • WebService-Lingr/trunk/lib/WebService/Lingr.pm

    r2146 r2152  
    22 
    33use strict; 
    4 our $VERSION = '0.01'; 
     4our $VERSION = '0.02'; 
    55 
    66use Carp; 
     
    6262sub call { 
    6363    my($self, $method, $args) = @_; 
    64     $self->_call($method, { %$args, session => $self->{session} }); 
     64    $args->{session} = $self->{session} if $self->{session}; 
     65    $self->_call($method, $args); 
    6566} 
    6667 
     
    6869    my($self, $method, $args) = @_; 
    6970 
    70     my @method = split /\./, $method; 
     71    my @method = map { s/([A-Z])/"_".lc($1)/eg; $_ } split /\./, $method; 
    7172    my $uri = URI->new($APIBase . "/" . join("/", @method)); 
    7273