Group
Extension

Matches 2

WebService-OANDA-ExchangeRates ( D/DD/DDOYLE/WebService-OANDA-ExchangeRates-0.003.tar.gz, DDOYLE, 2014; MetaCPAN )
WebService-OANDA-ExchangeRates/lib/WebService/OANDA/ExchangeRates.pm ( view source; MetaCPAN )
package WebService::OANDA::ExchangeRates;

use JSON::XS;
use LWP::UserAgent;
use Moo;
use Types::Standard qw{ ArrayRef Int Str StrMatch };
use Type::Utils qw{ declare as where coerce from via enum};
u
 if $type->has_coercion;
            if ( ! $type->check($val) ) {
                $val = JSON::XS::encode_json($val) if ref $val;
                die "invalid value: $key = ($val)";
            }
   

    return $ua;
}

# GET /currencies.json
sub get_currencies {
    my $self = shift;
    my %params = @_;

    my $response = $self->_get_request('currencies.json', \%params);

    # convert arrayref
WebService-OANDA-ExchangeRates ( D/DD/DDOYLE/WebService-OANDA-ExchangeRates-0.003.tar.gz, DDOYLE, 2014; MetaCPAN )
WebService-OANDA-ExchangeRates/lib/WebService/OANDA/ExchangeRates/Response.pm ( view source; MetaCPAN )
package WebService::OANDA::ExchangeRates::Response;

use Moo;

use HTTP::Response;
use JSON::XS qw{decode_json};
use Try::Tiny;

has http_response => (
    is  => 'rw',
    handles => {
        is_suc
s  => 'rw' );

sub BUILD {
    my $self = shift;
    my $data;

    try {
        $data = JSON::XS::decode_json( $self->raw_data );
    }
    catch {
        $data = {
            code => undef,
     
ent(%s): $%s', $self->raw_data, $_
            )
        };

        # if we failed to decode the json on a successful query, we'll consider
        # this an outlier and force a 500
        if ($self

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.