Class: OpenMeteo::Entities::Forecast
- Inherits:
-
Object
- Object
- OpenMeteo::Entities::Forecast
- Defined in:
- lib/open_meteo/entities/forecast.rb,
lib/open_meteo/entities/forecast/item.rb,
lib/open_meteo/entities/forecast/daily.rb,
lib/open_meteo/entities/forecast/units.rb,
lib/open_meteo/entities/forecast/hourly.rb,
lib/open_meteo/entities/forecast/current.rb,
lib/open_meteo/entities/forecast/minutely_15.rb
Overview
A forecast Entity with data returned by OpenMeteo
Defined Under Namespace
Classes: Current, Daily, Hourly, Item, Minutely15, Units
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#daily ⇒ Object
readonly
Returns the value of attribute daily.
-
#hourly ⇒ Object
readonly
Returns the value of attribute hourly.
-
#minutely_15 ⇒ Object
readonly
Returns the value of attribute minutely_15.
-
#raw_json ⇒ Object
readonly
Returns the value of attribute raw_json.
Instance Method Summary collapse
-
#initialize(json_body) ⇒ Forecast
constructor
A new instance of Forecast.
Constructor Details
#initialize(json_body) ⇒ Forecast
Returns a new instance of Forecast.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/open_meteo/entities/forecast.rb', line 15 def initialize(json_body) @raw_json = json_body init_data_for(OpenMeteo::Entities::Forecast::Current) init_data_for(OpenMeteo::Entities::Forecast::Minutely15) init_data_for(OpenMeteo::Entities::Forecast::Hourly) init_data_for(OpenMeteo::Entities::Forecast::Daily) @attributes = json_body.keys end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
13 14 15 |
# File 'lib/open_meteo/entities/forecast.rb', line 13 def attributes @attributes end |
#current ⇒ Object (readonly)
Returns the value of attribute current.
13 14 15 |
# File 'lib/open_meteo/entities/forecast.rb', line 13 def current @current end |
#daily ⇒ Object (readonly)
Returns the value of attribute daily.
13 14 15 |
# File 'lib/open_meteo/entities/forecast.rb', line 13 def daily @daily end |
#hourly ⇒ Object (readonly)
Returns the value of attribute hourly.
13 14 15 |
# File 'lib/open_meteo/entities/forecast.rb', line 13 def hourly @hourly end |
#minutely_15 ⇒ Object (readonly)
Returns the value of attribute minutely_15.
13 14 15 |
# File 'lib/open_meteo/entities/forecast.rb', line 13 def minutely_15 @minutely_15 end |
#raw_json ⇒ Object (readonly)
Returns the value of attribute raw_json.
13 14 15 |
# File 'lib/open_meteo/entities/forecast.rb', line 13 def raw_json @raw_json end |