NAME

Weather::OpenWeatherMap::Result - Weather lookup result superclass

SYNOPSIS

# Normally retrieved via Weather::OpenWeatherMap

DESCRIPTION

This is the parent class for Weather::OpenWeatherMap weather results.

The "SEE ALSO" section links known subclasses.

ATTRIBUTES

data

This is the decoded hash from the attached "json" (as a List::Objects::WithUtils::Hash).

Subclasses provide more convenient accessors for retrieving desired information.

error

The error message received from the OpenWeatherMap backend (or the empty string if there was no error).

See also: "is_success", "response_code"

is_success

Returns boolean true if the OpenWeatherMap backend returned a successful response.

See also: "error", "response_code"

json

The raw JSON this Result was created with.

response_code

The response code from OpenWeatherMap.

See also: "is_success", "error"

request

The original request that was attached to this result.

METHODS

new_for

Factory method; returns a new object belonging to the appropriate subclass:

my $result = Weather::OpenWeatherMap::Result->new_for(
  Forecast =>
    request => $orig_request,
    json    => $raw_json,
);

decode_json

Result deserialization wrapper for use by subclasses.

encode_json

Serialization wrapper for use by subclasses.

SEE ALSO

http://www.openweathermap.org/api

Weather::OpenWeatherMap::Result::Current

Weather::OpenWeatherMap::Result::Forecast

Weather::OpenWeatherMap::Result::Forecast::Block

Weather::OpenWeatherMap::Result::Forecast::Day

Weather::OpenWeatherMap::Result::Forecast::Hour

Weather::OpenWeatherMap::Result::Find

Weather::OpenWeatherMap::Request

AUTHOR

Jon Portnoy <avenj@cobaltirc.org>

Licensed under the same terms as perl.