Class: Netatmo::DashboardData::Wind
- Inherits:
-
Object
- Object
- Netatmo::DashboardData::Wind
- Defined in:
- lib/netatmo/dashboard_data/wind.rb
Instance Attribute Summary collapse
-
#gust_angle ⇒ Object
Returns the value of attribute gust_angle.
-
#gust_strength ⇒ Object
Returns the value of attribute gust_strength.
-
#max_wind_strength ⇒ Object
Returns the value of attribute max_wind_strength.
-
#max_wind_strength_date ⇒ Object
Returns the value of attribute max_wind_strength_date.
-
#time ⇒ Object
Returns the value of attribute time.
-
#unit ⇒ Object
Returns the value of attribute unit.
-
#wind_angle ⇒ Object
Returns the value of attribute wind_angle.
-
#wind_historic ⇒ Object
Returns the value of attribute wind_historic.
-
#wind_strength ⇒ Object
Returns the value of attribute wind_strength.
Instance Method Summary collapse
-
#initialize(data) ⇒ Wind
constructor
A new instance of Wind.
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ Wind
Returns a new instance of Wind.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 8 def initialize(data) return if data.nil? self.time = Time.at(data['time_utc']) self.wind_strength = data['WindStrength'].to_f self.max_wind_strength = data['max_wind_str'].to_f self.max_wind_strength_date = Time.at(data['date_max_wind_str']) self.wind_angle = data['WindAngle'].to_f self.gust_strength = data['Guststrength'].to_f self.gust_angle = data['GustAngle'].to_f self.wind_historic = data['WindHistoric'] self.unit = 'km/h' end |
Instance Attribute Details
#gust_angle ⇒ Object
Returns the value of attribute gust_angle.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def gust_angle @gust_angle end |
#gust_strength ⇒ Object
Returns the value of attribute gust_strength.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def gust_strength @gust_strength end |
#max_wind_strength ⇒ Object
Returns the value of attribute max_wind_strength.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def max_wind_strength @max_wind_strength end |
#max_wind_strength_date ⇒ Object
Returns the value of attribute max_wind_strength_date.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def max_wind_strength_date @max_wind_strength_date end |
#time ⇒ Object
Returns the value of attribute time.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def time @time end |
#unit ⇒ Object
Returns the value of attribute unit.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def unit @unit end |
#wind_angle ⇒ Object
Returns the value of attribute wind_angle.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def wind_angle @wind_angle end |
#wind_historic ⇒ Object
Returns the value of attribute wind_historic.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def wind_historic @wind_historic end |
#wind_strength ⇒ Object
Returns the value of attribute wind_strength.
6 7 8 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 6 def wind_strength @wind_strength end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/netatmo/dashboard_data/wind.rb', line 22 def to_s "#{wind_strength} #{unit}" end |