Class: Foursquare::Location

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

Instance Method Summary collapse

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

#addressObject



15
16
17
# File 'lib/foursquare/location.rb', line 15

def address
  @json["address"]
end

#cityObject



23
24
25
# File 'lib/foursquare/location.rb', line 23

def city
  @json["city"]
end

#countryObject



35
36
37
# File 'lib/foursquare/location.rb', line 35

def country
  @json["country"]
end

#cross_streetObject



19
20
21
# File 'lib/foursquare/location.rb', line 19

def cross_street
  @json["crossStreet"]
end

#distanceObject



47
48
49
# File 'lib/foursquare/location.rb', line 47

def distance
  @json["distance"]
end

#latObject



39
40
41
# File 'lib/foursquare/location.rb', line 39

def lat
  @json["lat"]
end

#lngObject



43
44
45
# File 'lib/foursquare/location.rb', line 43

def lng
  @json["lng"]
end

#postal_codeObject



31
32
33
# File 'lib/foursquare/location.rb', line 31

def postal_code
  @json["postalCode"]
end

#stateObject



27
28
29
# File 'lib/foursquare/location.rb', line 27

def state
  @json["state"]
end