Class: Yelp::Location

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

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Location

Returns a new instance of Location.



5
6
7
# File 'lib/yelp2/location.rb', line 5

def initialize(hash)
  @hash = hash
end

Instance Method Details

#addressObject



9
10
11
# File 'lib/yelp2/location.rb', line 9

def address
  @hash["address"]
end

#cityObject



17
18
19
# File 'lib/yelp2/location.rb', line 17

def city
  @hash["city"]
end

#countryObject



29
30
31
# File 'lib/yelp2/location.rb', line 29

def country
  @hash["country_code"]
end

#display_addressObject



13
14
15
# File 'lib/yelp2/location.rb', line 13

def display_address
  @hash["display_address"]
end

#latitudeObject



33
34
35
# File 'lib/yelp2/location.rb', line 33

def latitude
  @hash["coordinate"]["latitude"]
end

#longitudeObject



37
38
39
# File 'lib/yelp2/location.rb', line 37

def longitude
  @hash["coordinate"]["longitude"]
end

#neighborhoodsObject



41
42
43
# File 'lib/yelp2/location.rb', line 41

def neighborhoods
  @hash["neighborhoods"]
end

#postal_codeObject



25
26
27
# File 'lib/yelp2/location.rb', line 25

def postal_code
  @hash["postal_code"]
end

#stateObject



21
22
23
# File 'lib/yelp2/location.rb', line 21

def state
  @hash["state_code"]
end