class WeatherGov::Alert
Constants
- SUMMARY_KEYS
Public Instance Methods
active?()
click to toggle source
# File lib/weather_gov/alert.rb, line 37 def active? active_time_range.include?(Time.now) end
active_time_range()
click to toggle source
# File lib/weather_gov/alert.rb, line 33 def active_time_range effective_time...expires_time end
effective_time()
click to toggle source
# File lib/weather_gov/alert.rb, line 25 def effective_time Time.parse(properties.fetch("effective")) end
expires_time()
click to toggle source
# File lib/weather_gov/alert.rb, line 29 def expires_time Time.parse(properties.fetch("expires")) end
sent_time()
click to toggle source
# File lib/weather_gov/alert.rb, line 21 def sent_time Time.parse(properties.fetch("sent")) end
summary_hash()
click to toggle source
# File lib/weather_gov/alert.rb, line 41 def summary_hash properties.slice(*SUMMARY_KEYS) end