Class: LWS::Resource::Collection::WeatherLocation::Forecast

Inherits:
Item
  • Object
show all
Defined in:
lib/lws/apps/resource.rb

Overview

The collection weather location forecast class

Instance Attribute Summary collapse

Attributes inherited from Item

#collection, #collection_id, #metadata, #name, #position

Attributes inherited from Generic::Model

#created_at, #id, #updated_at, #url, #url_html

Method Summary

Methods inherited from Generic::Model

#dig, #reload, #rollback, #save

Instance Attribute Details

#codeInteger

Returns the code for the weather location forecast.

Returns:

  • (Integer)

    the code for the weather location forecast



443
# File 'lib/lws/apps/resource.rb', line 443

attribute :code

#dateInteger

Returns the timestamp of the date of the weather location forecast.

Returns:

  • (Integer)

    the timestamp of the date of the weather location forecast



447
# File 'lib/lws/apps/resource.rb', line 447

attribute :date

#descriptionInteger

Returns the description of the weather location forecast.

Returns:

  • (Integer)

    the description of the weather location forecast



451
# File 'lib/lws/apps/resource.rb', line 451

attribute :description

#observationBoolean

Returns whether the weather location forecast is a current observation.

Returns:

  • (Boolean)

    whether the weather location forecast is a current observation



456
# File 'lib/lws/apps/resource.rb', line 456

attribute :observation

#temperatureHash{String=>Float}

The temperature hash contains either the current temperature (key “now”) if the forecast is an observation or the temperature range (keys “low” and “high”) if it is not.

Returns:

  • (Hash{String=>Float})

    the temperature information of the weather location forecast



464
# File 'lib/lws/apps/resource.rb', line 464

attribute :temperature

#weather_locationCollection::WeatherLocation

Returns the collection weather location that the collection weather location post is a part of.

Returns:



469
470
471
# File 'lib/lws/apps/resource.rb', line 469

belongs_to :weather_location,
class_name: "LWS::Resource::Collection::WeatherLocation",
uri: "collections/:collection_id/weather_location(/:id)"

#weather_location_idInteger

Returns the ID of the collection weather location that the collection weather location is a post is part of.

Returns:

  • (Integer)

    the ID of the collection weather location that the collection weather location is a post is part of



476
# File 'lib/lws/apps/resource.rb', line 476

attribute :weather_location_id

#windHash{String=>Float}

The wind hash contains the wind chill temperature (key “chill”), direction in degrees (key “direction”), and wind speed (key “speed”).

Returns:

  • (Hash{String=>Float})

    the temperature information of the weather location forecast



483
# File 'lib/lws/apps/resource.rb', line 483

attribute :wind