Class: WeatherGov::AlertCollection

Inherits:
FeatureCollection show all
Defined in:
lib/weather_gov/alert_collection.rb

Instance Attribute Summary

Attributes inherited from Feature

#client

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FeatureCollection

#features

Methods inherited from Feature

#context, #data, #geometry, #id, #initialize, #properties, #type

Constructor Details

This class inherits a constructor from WeatherGov::Feature

Class Method Details

.feature_classObject



8
9
10
# File 'lib/weather_gov/alert_collection.rb', line 8

def self.feature_class
  Alert
end

Instance Method Details

#alertsObject



20
21
22
# File 'lib/weather_gov/alert_collection.rb', line 20

def alerts
  features
end

#summaryObject



24
25
26
# File 'lib/weather_gov/alert_collection.rb', line 24

def summary
  features.map(&:summary_hash)
end

#titleObject



16
17
18
# File 'lib/weather_gov/alert_collection.rb', line 16

def title
  data.fetch("title")
end

#update_timeObject



12
13
14
# File 'lib/weather_gov/alert_collection.rb', line 12

def update_time
  @update_time ||= Time.parse(data.fetch("updated"))
end