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