class Everlog::Dom::Value::Weather
Public Instance Methods
condition()
click to toggle source
# File lib/everlog/dom/value/weather.rb, line 13 def condition cond = maybe(icons.each.max).to_s cond == 'unknown' ? 'sunny' : cond end
max_temp()
click to toggle source
# File lib/everlog/dom/value/weather.rb, line 5 def max_temp maybe(tempms.each.max).to_i end
min_temp()
click to toggle source
# File lib/everlog/dom/value/weather.rb, line 9 def min_temp maybe(tempms.each.min).to_i end
Private Instance Methods
icons()
click to toggle source
# File lib/everlog/dom/value/weather.rb, line 23 def icons select_observations { |r| r['icon'] } end
select_observations(¶meter)
click to toggle source
# File lib/everlog/dom/value/weather.rb, line 27 def select_observations ¶meter maybe(@response)['observations'].to_a.map { |r| parameter.call(r) } end
tempms()
click to toggle source
# File lib/everlog/dom/value/weather.rb, line 19 def tempms select_observations { |r| r['tempm'].to_f } end