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, 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
57 58 59 60 61 62 |
# File 'lib/foursquare2/tips.rb', line 57 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.
79 80 81 82 83 84 |
# File 'lib/foursquare2/tips.rb', line 79 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.
68 69 70 71 72 73 |
# File 'lib/foursquare2/tips.rb', line 68 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.
24 25 26 27 28 29 |
# File 'lib/foursquare2/tips.rb', line 24 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.
8 9 10 11 12 13 |
# File 'lib/foursquare2/tips.rb', line 8 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.
90 91 92 93 94 95 |
# File 'lib/foursquare2/tips.rb', line 90 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.
40 41 42 43 44 45 46 47 48 |
# File 'lib/foursquare2/tips.rb', line 40 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 |