Class: NoaaWeatherClient::Responses::LatLonList
- Inherits:
-
Object
- Object
- NoaaWeatherClient::Responses::LatLonList
- Includes:
- ReactiveXmlResponse, ValidatableXmlResponse
- Defined in:
- lib/noaa_weather_client/responses/lat_lon_list.rb
Constant Summary
Constants included from ValidatableXmlResponse
ValidatableXmlResponse::SCHEMA_PATH
Instance Method Summary collapse
-
#initialize(response) ⇒ LatLonList
constructor
A new instance of LatLonList.
- #latitude ⇒ Object
- #longitude ⇒ Object
Methods included from ValidatableXmlResponse
Methods included from ReactiveXmlResponse
#method_missing, #respond_to_missing?, #source
Constructor Details
#initialize(response) ⇒ LatLonList
Returns a new instance of LatLonList.
11 12 13 14 |
# File 'lib/noaa_weather_client/responses/lat_lon_list.rb', line 11 def initialize(response) @source = XmlParserFactory.build_parser.parse(response) validate! @source, :dwml end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NoaaWeatherClient::Responses::ReactiveXmlResponse
Instance Method Details
#latitude ⇒ Object
16 17 18 |
# File 'lib/noaa_weather_client/responses/lat_lon_list.rb', line 16 def latitude @latitude ||= latLonList.split(",").first.to_f end |
#longitude ⇒ Object
20 21 22 |
# File 'lib/noaa_weather_client/responses/lat_lon_list.rb', line 20 def longitude @longitude ||= latLonList.split(",").last.to_f end |