Class: Barometer::Query::Converter::FromCoordinatesToNoaaStationId
- Inherits:
-
Object
- Object
- Barometer::Query::Converter::FromCoordinatesToNoaaStationId
- Defined in:
- lib/barometer/query/converters/from_coordinates_to_noaa_station_id.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(query) ⇒ FromCoordinatesToNoaaStationId
constructor
A new instance of FromCoordinatesToNoaaStationId.
Constructor Details
#initialize(query) ⇒ FromCoordinatesToNoaaStationId
Returns a new instance of FromCoordinatesToNoaaStationId.
9 10 11 |
# File 'lib/barometer/query/converters/from_coordinates_to_noaa_station_id.rb', line 9 def initialize(query) @query = query end |
Class Method Details
.from ⇒ Object
5 6 7 |
# File 'lib/barometer/query/converters/from_coordinates_to_noaa_station_id.rb', line 5 def self.from [:coordinates] end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 |
# File 'lib/barometer/query/converters/from_coordinates_to_noaa_station_id.rb', line 13 def call return unless can_convert? station_id = Service::NoaaStation.fetch(@query) @query.add_conversion(:noaa_station_id, station_id) end |