Class: Rlocu::Venue::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/rlocu/venue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ Location

Returns a new instance of Location.



95
96
97
98
99
100
101
102
103
104
# File 'lib/rlocu/venue.rb', line 95

def initialize(location)
  @address1 = location['address1']
  @address2 = location['address2']
  @address3 = location['address3']
  @locality = location['locality']
  @region = location['region']
  @postal_code = location['postal_code']
  @country = location['country']
  @geo = GeoJSON.new(location['geo'])
end

Instance Attribute Details

#address1Object (readonly)

Returns the value of attribute address1.



94
95
96
# File 'lib/rlocu/venue.rb', line 94

def address1
  @address1
end

#address2Object (readonly)

Returns the value of attribute address2.



94
95
96
# File 'lib/rlocu/venue.rb', line 94

def address2
  @address2
end

#address3Object (readonly)

Returns the value of attribute address3.



94
95
96
# File 'lib/rlocu/venue.rb', line 94

def address3
  @address3
end

#countryObject (readonly)

Returns the value of attribute country.



94
95
96
# File 'lib/rlocu/venue.rb', line 94

def country
  @country
end

#geoObject (readonly)

Returns the value of attribute geo.



94
95
96
# File 'lib/rlocu/venue.rb', line 94

def geo
  @geo
end

#localityObject (readonly)

Returns the value of attribute locality.



94
95
96
# File 'lib/rlocu/venue.rb', line 94

def locality
  @locality
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



94
95
96
# File 'lib/rlocu/venue.rb', line 94

def postal_code
  @postal_code
end

#regionObject (readonly)

Returns the value of attribute region.



94
95
96
# File 'lib/rlocu/venue.rb', line 94

def region
  @region
end

Instance Method Details

#latitudeObject



106
107
108
# File 'lib/rlocu/venue.rb', line 106

def latitude
  geo.latitude
end

#longitudeObject



110
111
112
# File 'lib/rlocu/venue.rb', line 110

def longitude
  geo.longitude
end