Module: FoursquareNext::Tips
- Included in:
- Client
- Defined in:
- lib/foursquare_next/tips.rb
Instance Method Summary collapse
-
#add_tip(options = {}) ⇒ Object
Add a tip.
-
#mark_tip_done(tip_id, options = {}) ⇒ Object
Mark a tip done for the authenticated user.
-
#mark_tip_todo(tip_id, options = {}) ⇒ Object
Mark a tip todo for the authenticated user.
-
#search_tips(options = {}) ⇒ Object
Search for tips.
-
#tip(tip_id, options = {}) ⇒ Object
Retrieve information about a tip.
-
#unmark_tip(tip_id, options = {}) ⇒ 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
56 57 58 59 60 61 |
# File 'lib/foursquare_next/tips.rb', line 56 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, options = {}) ⇒ Object
Mark a tip done for the authenticated user.
param [String] tip_id - The id of the tip to mark.
78 79 80 81 82 83 |
# File 'lib/foursquare_next/tips.rb', line 78 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, options = {}) ⇒ Object
Mark a tip todo for the authenticated user.
param [String] tip_id - The id of the tip to mark.
67 68 69 70 71 72 |
# File 'lib/foursquare_next/tips.rb', line 67 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.
23 24 25 26 27 28 |
# File 'lib/foursquare_next/tips.rb', line 23 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, options = {}) ⇒ Object
Retrieve information about a tip.
param [String] tip_id - The id of the tip to retrieve.
7 8 9 10 11 12 |
# File 'lib/foursquare_next/tips.rb', line 7 def tip(tip_id, ={}) response = connection.get do |req| req.url "tips/#{tip_id}", end return_error_or_body(response, response.body.response.tip) end |
#unmark_tip(tip_id, options = {}) ⇒ Object
Unmark a tip todo for the authenticated user.
param [String] tip_id - The id of the tip to unmark.
89 90 91 92 93 94 |
# File 'lib/foursquare_next/tips.rb', line 89 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.
39 40 41 42 43 44 45 46 47 |
# File 'lib/foursquare_next/tips.rb', line 39 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 = FoursquareNext.filter(tips, query) if query tips end |