Class: OpenMeteo::Entities::Forecast

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



13
14
15
# File 'lib/open_meteo/entities/forecast.rb', line 13

def attributes
  @attributes
end

#currentObject (readonly)

Returns the value of attribute current.



13
14
15
# File 'lib/open_meteo/entities/forecast.rb', line 13

def current
  @current
end

#dailyObject (readonly)

Returns the value of attribute daily.



13
14
15
# File 'lib/open_meteo/entities/forecast.rb', line 13

def daily
  @daily
end

#hourlyObject (readonly)

Returns the value of attribute hourly.



13
14
15
# File 'lib/open_meteo/entities/forecast.rb', line 13

def hourly
  @hourly
end

#minutely_15Object (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_jsonObject (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