Class: Foursquare::Location
- Inherits:
-
Object
- Object
- Foursquare::Location
- Defined in:
- lib/foursquare/location.rb
Instance Method Summary collapse
-
#[](key) ⇒ Object
this enabled the previous app to work with this new version where Location is now an object.
- #address ⇒ Object
- #city ⇒ Object
- #country ⇒ Object
- #cross_street ⇒ Object
- #distance ⇒ Object
-
#initialize(json) ⇒ Location
constructor
A new instance of Location.
- #lat ⇒ Object
- #lng ⇒ Object
- #postal_code ⇒ Object
- #state ⇒ Object
Constructor Details
#initialize(json) ⇒ Location
Returns a new instance of Location.
11 12 13 |
# File 'lib/foursquare/location.rb', line 11 def initialize(json) @json = json end |
Instance Method Details
#[](key) ⇒ Object
this enabled the previous app to work with this new version where Location is now an object
7 8 9 |
# File 'lib/foursquare/location.rb', line 7 def [](key) @json[key] end |
#address ⇒ Object
15 16 17 |
# File 'lib/foursquare/location.rb', line 15 def address @json["address"] end |
#city ⇒ Object
23 24 25 |
# File 'lib/foursquare/location.rb', line 23 def city @json["city"] end |
#country ⇒ Object
35 36 37 |
# File 'lib/foursquare/location.rb', line 35 def country @json["country"] end |
#cross_street ⇒ Object
19 20 21 |
# File 'lib/foursquare/location.rb', line 19 def cross_street @json["crossStreet"] end |
#distance ⇒ Object
47 48 49 |
# File 'lib/foursquare/location.rb', line 47 def distance @json["distance"] end |
#lat ⇒ Object
39 40 41 |
# File 'lib/foursquare/location.rb', line 39 def lat @json["lat"] end |
#lng ⇒ Object
43 44 45 |
# File 'lib/foursquare/location.rb', line 43 def lng @json["lng"] end |
#postal_code ⇒ Object
31 32 33 |
# File 'lib/foursquare/location.rb', line 31 def postal_code @json["postalCode"] end |
#state ⇒ Object
27 28 29 |
# File 'lib/foursquare/location.rb', line 27 def state @json["state"] end |