Class: WeatherGov::Office

Inherits:
Feature
  • Object
show all
Defined in:
lib/weather_gov/office.rb

Instance Attribute Summary

Attributes inherited from Feature

#client

Instance Method Summary collapse

Methods inherited from Feature

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

Constructor Details

This class inherits a constructor from WeatherGov::Feature

Instance Method Details

#addressObject



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

def address
  @address ||= Address.new(data.fetch("address"))
end

#approved_observation_station_idsObject



64
65
66
# File 'lib/weather_gov/office.rb', line 64

def approved_observation_station_ids
  data.fetch("approvedObservationStations", []).map { |uri| Identifier::Station.new(uri).id }
end

#approved_observation_stationsObject



60
61
62
# File 'lib/weather_gov/office.rb', line 60

def approved_observation_stations
  data.fetch("approvedObservationStations", []).map { |uri| client.station(uri: uri, value: uri) }
end

#emailObject



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

def email
  data.fetch("email")
end

#faxObject



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

def fax
  data.fetch("faxNumber")
end

#nameObject



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

def name
  data.fetch("name")
end

#nws_regionObject



28
29
30
# File 'lib/weather_gov/office.rb', line 28

def nws_region
  data.fetch("nwsRegion")
end

#parent_organizationObject



32
33
34
# File 'lib/weather_gov/office.rb', line 32

def parent_organization
  data.fetch("parentOrganization")
end

#responsible_countiesObject



36
37
38
# File 'lib/weather_gov/office.rb', line 36

def responsible_counties
  data.fetch("responsibleCounties", [])
end

#responsible_county_idsObject



40
41
42
# File 'lib/weather_gov/office.rb', line 40

def responsible_county_ids
  data.fetch("responsibleCounties", []).map { |uri| Identifier::CountyZone.new(uri).id }
end

#responsible_fire_zone_idsObject



56
57
58
# File 'lib/weather_gov/office.rb', line 56

def responsible_fire_zone_ids
  data.fetch("responsibleFireZones", []).map { |uri| Identifier::FireZone.new(uri).id }
end

#responsible_fire_zonesObject



52
53
54
# File 'lib/weather_gov/office.rb', line 52

def responsible_fire_zones
  data.fetch("responsibleFireZones", [])
end

#responsible_forecast_zone_idsObject



48
49
50
# File 'lib/weather_gov/office.rb', line 48

def responsible_forecast_zone_ids
  data.fetch("responsibleForecastZones", []).map { |uri| Identifier::ForecastZone.new(uri).id }
end

#responsible_forecast_zonesObject



44
45
46
# File 'lib/weather_gov/office.rb', line 44

def responsible_forecast_zones
  data.fetch("responsibleForecastZones", [])
end

#telephoneObject



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

def telephone
  data.fetch("telephone")
end