Class: WeatherGov::Zone
Instance Attribute Summary
Attributes inherited from Feature
#client
Instance Method Summary
collapse
Methods inherited from Feature
#context, #data, #geometry, #id, #initialize, #properties
Instance Method Details
#effective_date ⇒ Object
17
18
19
|
# File 'lib/weather_gov/zone.rb', line 17
def effective_date
Time.parse(properties.fetch("effectiveDate"))
end
|
#expiration ⇒ Object
21
22
23
|
# File 'lib/weather_gov/zone.rb', line 21
def expiration
Time.parse(properties.fetch("expirationDate"))
end
|
#forecast_office_identifiers ⇒ Object
25
26
27
|
# File 'lib/weather_gov/zone.rb', line 25
def forecast_office_identifiers
properties.fetch("forecastOffices", []).map { |uri| Identifier::Office.new(uri) }
end
|
#forecast_offices ⇒ Object
29
30
31
|
# File 'lib/weather_gov/zone.rb', line 29
def forecast_offices
forecast_office_identifiers.map { |identifier| client.office(uri: identifier.uri) }
end
|
#name ⇒ Object
9
10
11
|
# File 'lib/weather_gov/zone.rb', line 9
def name
properties.fetch("name")
end
|
#state ⇒ Object
13
14
15
|
# File 'lib/weather_gov/zone.rb', line 13
def state
properties.fetch("state")
end
|
#type ⇒ Object
5
6
7
|
# File 'lib/weather_gov/zone.rb', line 5
def type
properties.fetch("type")
end
|