summaryrefslogtreecommitdiff
path: root/lib/WebService/ForecastIo.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/WebService/ForecastIo.pm')
-rw-r--r--lib/WebService/ForecastIo.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/WebService/ForecastIo.pm b/lib/WebService/ForecastIo.pm
index 45e7802..a2ef8ec 100644
--- a/lib/WebService/ForecastIo.pm
+++ b/lib/WebService/ForecastIo.pm
@@ -5,6 +5,7 @@ use MooseX::Types::DateTime;
use MooseX::Params::Validate;
use Moose::Util::TypeConstraints;
use DateTime::Format::ISO8601;
+use WebService::ForecastIo::Response;
has base_uri => (
is => 'ro',
@@ -55,7 +56,7 @@ sub _make_request_uri {
}
$req_uri->path_segments(
- grep { length($_)>0 }
+ grep { length($_) }
$req_uri->path_segments,
$self->api_key,
"$lat,$lon",
@@ -96,7 +97,9 @@ sub request {
my $response = $self->user_agent->get($uri);
if ($response->is_success) {
- return $response->decoded_content;
+ return WebService::ForecastIo::Response->new(
+ $response->decoded_content,
+ );
}
else {
die $response->status_line