Jon Portnoy

NAME

Weather::OpenWeatherMap::Result::Forecast - Weather forecast result

SYNOPSIS

  # Normally retrieved via Weather::OpenWeatherMap

DESCRIPTION

This is a subclass of Weather::OpenWeatherMap::Result containing the result of a completed Weather::OpenWeatherMap::Request::Forecast.

These are normally emitted by a Weather::OpenWeatherMap instance.

ATTRIBUTES

count

The number of forecasts (days) as returned by the OpenWeatherMap API.

See "list" and "iter".

country

The country string.

id

The OpenWeatherMap city code.

latitude

The station's latitude.

longitude

The station's longitude.

name

The city name.

METHODS

as_array

The full forecast list, as a List::Objects::WithUtils::Array.

See "list".

list

The full forecast list; each item in the list is a Weather::OpenWeatherMap::Result::Forecast::Day instance:

  for my $day ($result->list) {
    my $date = $day->dt->mdy;
    my $cloudiness = $day->cloud_coverage;
    # ...
  }

See the documentation for Weather::OpenWeatherMap::Result::Forecast::Day.

iter

Returns an iterator that, when called, returns the next Weather::OpenWeatherMap::Result::Forecast::Day instance (or undef when the list is empty):

  my $iter = $result->iter;
  while (my $day = $iter->()) {
    my $wind = $day->wind_speed_mph;
    # ...
  }

See the documentation for Weather::OpenWeatherMap::Result::Forecast::Day.

See also: "list"

SEE ALSO

http://www.openweathermap.org

Weather::OpenWeatherMap

Weather::OpenWeatherMap::Result

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

Weather::OpenWeatherMap::Result::Current

AUTHOR

Jon Portnoy <avenj@cobaltirc.org>