The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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.

See also:

Weather::OpenWeatherMap::Result::Current

Weather::OpenWeatherMap::Result::Forecast

ATTRIBUTES

data

This is the decoded hash from the attached "json".

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,
  );

SEE ALSO

http://www.openweathermap.org

Weather::OpenWeatherMap

Weather::OpenWeatherMap::Result::Current

Weather::OpenWeatherMap::Result::Forecast

AUTHOR

Jon Portnoy <avenj@cobaltirc.org>

Licensed under the same terms as perl.