Class: Weatherstorm::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/weatherstorm/location.rb

Overview

Defines a location based on a given input.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#latitudeObject (readonly)

Returns the value of attribute latitude.



6
7
8
# File 'lib/weatherstorm/location.rb', line 6

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



6
7
8
# File 'lib/weatherstorm/location.rb', line 6

def longitude
  @longitude
end