NAME

Weather::YR::LocationForecast - Object-oriented interface to Yr.no's "location forecast" API.

DESCRIPTION

Don't use this class directly. Instead, access it from the Weather::YR class.

METHODS

url

Returns the URL for YR.no's location forecast service. This is handy if you want to retrieve the XML from YR.no yourself;

my $yr = Weather::YR->new(
    lat => 63.590833,
    lon => 10.741389,
);

my $url = $yr->location_forecast->url;

my $xml = My FancyHttpClient->new->get( $url );

my $yr = Weather::YR->new(
    xml => $xml,
    tz  => DateTime::TimeZone->new( name => 'Europe/Oslo' ),
);

my $forecast = $yr->location_forecast;

datapoints

Returns an array reference of Weather::YR::LocationForecast::DataPoint instances.

days

Returns an array reference of Weather::YR::LocationForecast::Day instances.

now

Returns a Weather::YR::LocationForecast::Day instance, representing the closest forecast in time.

today

Returns a Weather::YR::LocationForecast::Day instance, representing today's weather.

tomorrow

Returns a Weather::YR::LocationForecast::Day instance, representing tomorrow's weather.