Class: Forecastr::Forecast
- Inherits:
-
Object
- Object
- Forecastr::Forecast
- Defined in:
- lib/forecastr/forecast.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#clouds ⇒ Object
readonly
Returns the value of attribute clouds.
-
#humidity ⇒ Object
readonly
Returns the value of attribute humidity.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#max_temperature ⇒ Object
readonly
Returns the value of attribute max_temperature.
-
#min_temperature ⇒ Object
readonly
Returns the value of attribute min_temperature.
-
#pressure ⇒ Object
readonly
Returns the value of attribute pressure.
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
-
#wind ⇒ Object
readonly
Returns the value of attribute wind.
Instance Method Summary collapse
-
#initialize(data) ⇒ Forecast
constructor
A new instance of Forecast.
Constructor Details
#initialize(data) ⇒ Forecast
Returns a new instance of Forecast.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/forecastr/forecast.rb', line 8 def initialize(data) @city = data.city @longitude = data.longitude @latitude = data.latitude @temperature = Forecastr::Temperature.new(data.temperature) @pressure = data.pressure @humidity = data.humidity @min_temperature = Forecastr::Temperature.new(data.min_temperature) @max_temperature = Forecastr::Temperature.new(data.max_temperature) @clouds = data.clouds @wind = Forecastr::Wind.new(data.wind_speed, data.wind_angle) end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def city @city end |
#clouds ⇒ Object (readonly)
Returns the value of attribute clouds.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def clouds @clouds end |
#humidity ⇒ Object (readonly)
Returns the value of attribute humidity.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def humidity @humidity end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def longitude @longitude end |
#max_temperature ⇒ Object (readonly)
Returns the value of attribute max_temperature.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def max_temperature @max_temperature end |
#min_temperature ⇒ Object (readonly)
Returns the value of attribute min_temperature.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def min_temperature @min_temperature end |
#pressure ⇒ Object (readonly)
Returns the value of attribute pressure.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def pressure @pressure end |
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def temperature @temperature end |
#wind ⇒ Object (readonly)
Returns the value of attribute wind.
4 5 6 |
# File 'lib/forecastr/forecast.rb', line 4 def wind @wind end |