Class: Firstfm::Location
- Inherits:
-
Object
- Object
- Firstfm::Location
- Defined in:
- lib/firstfm/location.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#long ⇒ Object
Returns the value of attribute long.
-
#postalcode ⇒ Object
Returns the value of attribute postalcode.
-
#street ⇒ Object
Returns the value of attribute street.
Class Method Summary collapse
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
5 6 7 |
# File 'lib/firstfm/location.rb', line 5 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'lib/firstfm/location.rb', line 5 def country @country end |
#lat ⇒ Object
Returns the value of attribute lat.
5 6 7 |
# File 'lib/firstfm/location.rb', line 5 def lat @lat end |
#long ⇒ Object
Returns the value of attribute long.
5 6 7 |
# File 'lib/firstfm/location.rb', line 5 def long @long end |
#postalcode ⇒ Object
Returns the value of attribute postalcode.
5 6 7 |
# File 'lib/firstfm/location.rb', line 5 def postalcode @postalcode end |
#street ⇒ Object
Returns the value of attribute street.
5 6 7 |
# File 'lib/firstfm/location.rb', line 5 def street @street end |
Class Method Details
.init_location_from_hash(hash) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/firstfm/location.rb', line 7 def self.init_location_from_hash(hash) return nil unless hash.is_a?(Hash) location = Location.new location.city = hash["city"] location.country = hash["country"] location.postalcode = hash["postalcode"] location.street = hash["street"] location.lat = hash["geo:point"]["geo:lat"] if hash["geo:point"] location.long = hash["geo:point"]["geo:long"] if hash["geo:point"] location end |