Class: Yelp::Location
- Inherits:
-
Object
- Object
- Yelp::Location
- Defined in:
- lib/yelp2/location.rb
Instance Method Summary collapse
- #address ⇒ Object
- #city ⇒ Object
- #country ⇒ Object
- #display_address ⇒ Object
-
#initialize(hash) ⇒ Location
constructor
A new instance of Location.
- #latitude ⇒ Object
- #longitude ⇒ Object
- #neighborhoods ⇒ Object
- #postal_code ⇒ Object
- #state ⇒ Object
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
#address ⇒ Object
9 10 11 |
# File 'lib/yelp2/location.rb', line 9 def address @hash["address"] end |
#city ⇒ Object
17 18 19 |
# File 'lib/yelp2/location.rb', line 17 def city @hash["city"] end |
#country ⇒ Object
29 30 31 |
# File 'lib/yelp2/location.rb', line 29 def country @hash["country_code"] end |
#display_address ⇒ Object
13 14 15 |
# File 'lib/yelp2/location.rb', line 13 def display_address @hash["display_address"] end |
#latitude ⇒ Object
33 34 35 |
# File 'lib/yelp2/location.rb', line 33 def latitude @hash["coordinate"]["latitude"] end |
#longitude ⇒ Object
37 38 39 |
# File 'lib/yelp2/location.rb', line 37 def longitude @hash["coordinate"]["longitude"] end |
#neighborhoods ⇒ Object
41 42 43 |
# File 'lib/yelp2/location.rb', line 41 def neighborhoods @hash["neighborhoods"] end |
#postal_code ⇒ Object
25 26 27 |
# File 'lib/yelp2/location.rb', line 25 def postal_code @hash["postal_code"] end |
#state ⇒ Object
21 22 23 |
# File 'lib/yelp2/location.rb', line 21 def state @hash["state_code"] end |