Class: Netatmo::DashboardData::Rain
- Inherits:
-
Object
- Object
- Netatmo::DashboardData::Rain
- Defined in:
- lib/netatmo/dashboard_data/rain.rb
Instance Attribute Summary collapse
-
#sum_rain_1 ⇒ Object
Returns the value of attribute sum_rain_1.
-
#sum_rain_24 ⇒ Object
Returns the value of attribute sum_rain_24.
-
#time ⇒ Object
Returns the value of attribute time.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data) ⇒ Rain
constructor
A new instance of Rain.
- #last_day ⇒ Object
- #last_hour ⇒ Object
- #rain ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ Rain
Returns a new instance of Rain.
8 9 10 11 12 13 14 15 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 8 def initialize(data) return if data.nil? self.time = Time.at(data['time_utc']) self.value = data['Rain'].to_f self.sum_rain_1 = data['sum_rain_1'].to_f self.sum_rain_24 = data['sum_rain_24'].to_f end |
Instance Attribute Details
#sum_rain_1 ⇒ Object
Returns the value of attribute sum_rain_1.
6 7 8 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 6 def sum_rain_1 @sum_rain_1 end |
#sum_rain_24 ⇒ Object
Returns the value of attribute sum_rain_24.
6 7 8 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 6 def sum_rain_24 @sum_rain_24 end |
#time ⇒ Object
Returns the value of attribute time.
6 7 8 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 6 def time @time end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 6 def value @value end |
Instance Method Details
#last_day ⇒ Object
29 30 31 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 29 def last_day sum_rain_24 end |
#last_hour ⇒ Object
25 26 27 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 25 def last_hour sum_rain_1 end |
#rain ⇒ Object
21 22 23 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 21 def rain value end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/netatmo/dashboard_data/rain.rb', line 17 def to_s value end |