Class: Grubber::Client
- Inherits:
-
Object
- Object
- Grubber::Client
- Defined in:
- lib/grubber/client.rb
Constant Summary collapse
- HOST =
'api.yelp.com'
Instance Attribute Summary collapse
-
#consumer_key ⇒ Object
Returns the value of attribute consumer_key.
-
#consumer_secret ⇒ Object
Returns the value of attribute consumer_secret.
-
#token_key ⇒ Object
Returns the value of attribute token_key.
-
#token_secret ⇒ Object
Returns the value of attribute token_secret.
Instance Method Summary collapse
Instance Attribute Details
#consumer_key ⇒ Object
Returns the value of attribute consumer_key.
9 10 11 |
# File 'lib/grubber/client.rb', line 9 def consumer_key @consumer_key end |
#consumer_secret ⇒ Object
Returns the value of attribute consumer_secret.
9 10 11 |
# File 'lib/grubber/client.rb', line 9 def consumer_secret @consumer_secret end |
#token_key ⇒ Object
Returns the value of attribute token_key.
9 10 11 |
# File 'lib/grubber/client.rb', line 9 def token_key @token_key end |
#token_secret ⇒ Object
Returns the value of attribute token_secret.
9 10 11 |
# File 'lib/grubber/client.rb', line 9 def token_secret @token_secret end |
Instance Method Details
#search(term, opts = {}) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/grubber/client.rb', line 11 def search(term, opts={}) lat, lng = *Grubber::CONFIG.coordinates yelp = connection return [] if yelp.nil? response = yelp.get("/v2/search?term=#{term}&ll=#{lat},#{lng}") Restaurant.parse(response.body) end |