Class: Weatherstorm::Location
- Inherits:
-
Object
- Object
- Weatherstorm::Location
- Defined in:
- lib/weatherstorm/location.rb
Overview
Defines a location based on a given input.
Instance Attribute Summary collapse
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
Instance Method Summary collapse
-
#initialize(address) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(address) ⇒ Location
Returns a new instance of Location.
7 8 9 10 11 |
# File 'lib/weatherstorm/location.rb', line 7 def initialize(address) result = Geocoder.coordinates(address) @latitude = result[0] @longitude = result[1] end |
Instance Attribute Details
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
6 7 8 |
# File 'lib/weatherstorm/location.rb', line 6 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
6 7 8 |
# File 'lib/weatherstorm/location.rb', line 6 def longitude @longitude end |