Class: SoraGeocoding::Results::Base
- Inherits:
-
Object
- Object
- SoraGeocoding::Results::Base
- Defined in:
- lib/sora_geocoding/results/base.rb
Overview
The Foundation for Returning Results
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #coordinates ⇒ Object
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
- #latitude ⇒ Object
- #longitude ⇒ Object
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
11 12 13 |
# File 'lib/sora_geocoding/results/base.rb', line 11 def initialize(data) @data = REXML::Document.new(data) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
9 10 11 |
# File 'lib/sora_geocoding/results/base.rb', line 9 def data @data end |
Instance Method Details
#coordinates ⇒ Object
15 16 17 |
# File 'lib/sora_geocoding/results/base.rb', line 15 def coordinates { lat: @data['lat'], lon: @data['lon'] } end |
#latitude ⇒ Object
19 20 21 |
# File 'lib/sora_geocoding/results/base.rb', line 19 def latitude coordinates[:lat] end |
#longitude ⇒ Object
23 24 25 |
# File 'lib/sora_geocoding/results/base.rb', line 23 def longitude coordinates[:lon] end |