t AREA_ENDPOINT => 'http://express.heartrails.com/api/json?method=getAreas';
use constant PREF_ENDPOINT => 'http://express.heartrails.com/api/json?method=getPrefectures';
sub _build_areas{
my $self
= JSON::decode_json($response->{content});
return $content->{response}->{area};
}
sub _build_prefs{
my $self = shift;
my $response = $self->provider->furl->get(PREF_ENDPOINT);
my $content = JSON:
:decode_json($response->{content});
return $content->{response}->{prefecture};
}
no Mouse;
__PACKAGE__->meta->make_immutable;
1;
__END__
=encoding utf-8
=head1 NAME
WebService::Heartrails::Expr
;
use warnings;
use utf8;
use constant API_ENDPOINT => 'http://express.heartrails.com/api/json?';
use JSON;
use Encode;
use URI;
sub call{
my($class,$sub_url) = @_;
my $uri = URI->new(API_ENDPO
ea => $area,prefecture => $prefecture};
}
};
my $content = WebService::Heartrails::Express::Provider::Common::call($class,$sub_url);
return JSON::decode_json($content)->{response}->{line};
}
1;
'getStations',x => $x,y => $y};
}
};
my $content = WebService::Heartrails::Express::Provider::Common::call($class,$sub_url);
return JSON::decode_json($content)->{response}->{station};
}
1;
ne => $line ,name => $name};
}
};
my $content = WebService::Heartrails::Express::Provider::Common::call($class,$sub_url);
return JSON::decode_json($content)->{response}->{station};
}
1;