Module: Foursquare2::Tips
- Included in:
- Client
- Defined in:
- lib/foursquare2/tips.rb
Instance Method Summary collapse
-
#add_tip(options = {}) ⇒ Object
Add a tip.
-
#mark_tip_done(tip_id) ⇒ Object
Mark a tip done for the authenticated user.
-
#mark_tip_todo(tip_id) ⇒ Object
Mark a tip todo for the authenticated user.
-
#search_tips(options = {}) ⇒ Object
Search for tips.
-
#tip(tip_id) ⇒ Object
Retrieve information about a tip.
-
#unmark_tip(tip_id) ⇒ Object
Unmark a tip todo for the authenticated user.
-
#venue_tips(venue_id, options = {}) ⇒ Object
Search for tips from a venue.
Instance Method Details
#add_tip(options = {}) ⇒ Object
Add a tip
55 56 57 58 59 60 |
# File 'lib/foursquare2/tips.rb', line 55 def add_tip(={}) response = connection.post do |req| req.url "tips/add", end return_error_or_body(response, response.body.response.tip) end |
#mark_tip_done(tip_id) ⇒ Object
Mark a tip done for the authenticated user.
param [String] tip_id - The id of the tip to mark.
77 78 79 80 81 82 |
# File 'lib/foursquare2/tips.rb', line 77 def mark_tip_done(tip_id) response = connection.post do |req| req.url "tips/#{tip_id}/markdone" end return_error_or_body(response, response.body.response) end |
#mark_tip_todo(tip_id) ⇒ Object
Mark a tip todo for the authenticated user.
param [String] tip_id - The id of the tip to mark.
66 67 68 69 70 71 |
# File 'lib/foursquare2/tips.rb', line 66 def mark_tip_todo(tip_id) response = connection.post do |req| req.url "tips/#{tip_id}/marktodo" end return_error_or_body(response, response.body.response) end |
#search_tips(options = {}) ⇒ Object
Search for tips.
22 23 24 25 26 27 |
# File 'lib/foursquare2/tips.rb', line 22 def search_tips(={}) response = connection.get do |req| req.url "tips/search", end return_error_or_body(response, response.body.response.tips) end |
#tip(tip_id) ⇒ Object
Retrieve information about a tip.
param [String] tip_id - The id of the tip to retrieve.
8 9 10 11 |
# File 'lib/foursquare2/tips.rb', line 8 def tip(tip_id) response = connection.get("tips/#{tip_id}") return_error_or_body(response, response.body.response.tip) end |
#unmark_tip(tip_id) ⇒ Object
Unmark a tip todo for the authenticated user.
param [String] tip_id - The id of the tip to unmark.
88 89 90 91 92 93 |
# File 'lib/foursquare2/tips.rb', line 88 def unmark_tip(tip_id) response = connection.post do |req| req.url "tips/#{tip_id}/unmark" end return_error_or_body(response, response.body.response) end |
#venue_tips(venue_id, options = {}) ⇒ Object
Search for tips from a venue.
38 39 40 41 42 43 44 45 46 |
# File 'lib/foursquare2/tips.rb', line 38 def venue_tips(venue_id, ={}) query = .delete(:query) response = connection.get do |req| req.url "venues/#{venue_id}/tips", end tips = return_error_or_body(response, response.body.response.tips) tips = Foursquare2.filter(tips, query) if query tips end |