Class: Cora::Location
- Inherits:
-
Object
- Object
- Cora::Location
- Extended by:
- Forwardable
- Defined in:
- lib/cora/location.rb
Instance Attribute Summary collapse
-
#extra ⇒ Object
readonly
Returns the value of attribute extra.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
Instance Method Summary collapse
-
#initialize(latitude, longitude, extra = {}) ⇒ Location
constructor
A new instance of Location.
-
#result ⇒ Object
Returns nil if geolocation failed, or an instance of Geocoder::Result::Google See: rubydoc.info/github/alexreisner/geocoder/master/Geocoder/Result/Google.
-
#results ⇒ Object
Returns an array of objects of class Geocoder::Result::Google (probably).
Constructor Details
#initialize(latitude, longitude, extra = {}) ⇒ Location
Returns a new instance of Location.
11 12 13 14 15 |
# File 'lib/cora/location.rb', line 11 def initialize(latitude, longitude, extra = {}) @latitude = latitude @longitude = longitude @extra = extra end |
Instance Attribute Details
#extra ⇒ Object (readonly)
Returns the value of attribute extra.
9 10 11 |
# File 'lib/cora/location.rb', line 9 def extra @extra end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
9 10 11 |
# File 'lib/cora/location.rb', line 9 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
9 10 11 |
# File 'lib/cora/location.rb', line 9 def longitude @longitude end |
Instance Method Details
#result ⇒ Object
Returns nil if geolocation failed, or an instance of Geocoder::Result::Google See: rubydoc.info/github/alexreisner/geocoder/master/Geocoder/Result/Google
19 20 21 |
# File 'lib/cora/location.rb', line 19 def result results.first end |
#results ⇒ Object
Returns an array of objects of class Geocoder::Result::Google (probably)
24 25 26 |
# File 'lib/cora/location.rb', line 24 def results @results ||= perform_reverse_geocode end |