Class: WeatherGov::Point
Instance Attribute Summary
Attributes inherited from Feature
#client
Instance Method Summary
collapse
Methods inherited from Feature
#context, #data, #geometry, #id, #initialize, #properties, #type
Instance Method Details
#alerts_active ⇒ Object
56
57
58
|
# File 'lib/weather_gov/point.rb', line 56
def alerts_active
@alerts_active ||= client.alerts_active(zone: forecast_zone_identifier.id)
end
|
#county_zone ⇒ Object
28
29
30
|
# File 'lib/weather_gov/point.rb', line 28
def county_zone
@county_zone ||= client.zone(uri: county_zone_identifier.uri)
end
|
#county_zone_identifier ⇒ Object
24
25
26
|
# File 'lib/weather_gov/point.rb', line 24
def county_zone_identifier
@county_zone_identifier ||= Identifier::CountyZone.new(properties.fetch("county"))
end
|
#fire_zone ⇒ Object
36
37
38
|
# File 'lib/weather_gov/point.rb', line 36
def fire_zone
@fire_zone ||= client.zone(uri: fire_zone_identifier.uri)
end
|
#fire_zone_identifier ⇒ Object
32
33
34
|
# File 'lib/weather_gov/point.rb', line 32
def fire_zone_identifier
@fire_zone_identifier ||= Identifier::FireZone.new(properties.fetch("fireWeatherZone"))
end
|
#forecast ⇒ Object
64
65
66
|
# File 'lib/weather_gov/point.rb', line 64
def forecast
@forecast ||= client.forecast(uri: properties.fetch("forecast"))
end
|
#forecast_grid_data ⇒ Object
40
41
42
|
# File 'lib/weather_gov/point.rb', line 40
def forecast_grid_data
@forecast_grid_data ||= Identifier::Gridpoint.new(properties.fetch("forecastGridData"))
end
|
#forecast_hourly ⇒ Object
68
69
70
|
# File 'lib/weather_gov/point.rb', line 68
def forecast_hourly
@forecast_hourly ||= client.forecast(uri: properties.fetch("forecastHourly"))
end
|
#forecast_office ⇒ Object
12
13
14
|
# File 'lib/weather_gov/point.rb', line 12
def forecast_office
@forecast_office ||= client.office(uri: forecast_office_identifier.uri)
end
|
#forecast_office_identifier ⇒ Object
8
9
10
|
# File 'lib/weather_gov/point.rb', line 8
def forecast_office_identifier
@forecast_office_identifier ||= Identifier::Office.new(properties.fetch("forecastOffice"))
end
|
#forecast_zone ⇒ Object
20
21
22
|
# File 'lib/weather_gov/point.rb', line 20
def forecast_zone
@forecast_zone ||= client.zone(uri: forecast_zone_identifier.uri)
end
|
#forecast_zone_identifier ⇒ Object
16
17
18
|
# File 'lib/weather_gov/point.rb', line 16
def forecast_zone_identifier
@forecast_zone_identifier ||= Identifier::ForecastZone.new(properties.fetch("forecastZone"))
end
|
#gridpoint ⇒ Object
60
61
62
|
# File 'lib/weather_gov/point.rb', line 60
def gridpoint
@gridpoint ||= client.gridpoint(uri: properties.fetch("forecastGridData"))
end
|
#observation_stations ⇒ Object
52
53
54
|
# File 'lib/weather_gov/point.rb', line 52
def observation_stations
@observation_stations ||= client.stations(uri: properties.fetch("observationStations"))
end
|
#product(type) ⇒ Object
77
78
79
|
# File 'lib/weather_gov/point.rb', line 77
def product(type)
products(type).first.product
end
|
#products(type) ⇒ Object
72
73
74
75
|
# File 'lib/weather_gov/point.rb', line 72
def products(type)
@products ||= {}
@products[type] ||= client.products(type: type, location: forecast_office_identifier.id)
end
|
#radar_station ⇒ Object
48
49
50
|
# File 'lib/weather_gov/point.rb', line 48
def radar_station
properties.fetch("radarStation")
end
|
#relative_location ⇒ Object
44
45
46
|
# File 'lib/weather_gov/point.rb', line 44
def relative_location
@relative_location ||= RelativeLocation.new(client: client, data: properties.fetch("relativeLocation"))
end
|