Module: Foursquare2::Lists
- Included in:
- Client
- Defined in:
- lib/foursquare2/lists.rb
Instance Method Summary collapse
-
#add_list(options = {}) ⇒ Object
Add a list: See developer.foursquare.com/docs/lists/add.
-
#add_list_item(list_id, options = {}) ⇒ Object
Add an item to a list: developer.foursquare.com/docs/lists/additem.
-
#delete_list_item(list_id, item_id, options = {}) ⇒ Object
Delete an item from a list: developer.foursquare.com/docs/lists/deleteitem.
-
#follow_list(list_id, options = {}) ⇒ Object
Follow a list: developer.foursquare.com/docs/lists/follow.
-
#list(list_id, options = {}) ⇒ Object
Retrieve information about a list.
-
#move_list_item(list_id, item_id, options = {}) ⇒ Object
Move an item on a list: developer.foursquare.com/docs/lists/moveitem.
-
#unfollow_list(list_id, options = {}) ⇒ Object
Unfollow a list: developer.foursquare.com/docs/lists/unfollow.
-
#update_list(list_id, options = {}) ⇒ Object
Update a list: developer.foursquare.com/docs/lists/update.
Instance Method Details
permalink #add_list(options = {}) ⇒ Object
Add a list: See developer.foursquare.com/docs/lists/add
26 27 28 29 30 31 |
# File 'lib/foursquare2/lists.rb', line 26 def add_list(={}) response = connection.post do |req| req.url "lists/add", end return_error_or_body(response, response.body.response.list) end |
permalink #add_list_item(list_id, options = {}) ⇒ Object
Add an item to a list: developer.foursquare.com/docs/lists/additem
82 83 84 85 86 87 |
# File 'lib/foursquare2/lists.rb', line 82 def add_list_item(list_id, ={}) response = connection.post do |req| req.url "lists/#{list_id}/additem", end return_error_or_body(response, response.body.response.item) end |
permalink #delete_list_item(list_id, item_id, options = {}) ⇒ Object
Delete an item from a list: developer.foursquare.com/docs/lists/deleteitem
94 95 96 97 98 99 |
# File 'lib/foursquare2/lists.rb', line 94 def delete_list_item(list_id, item_id, ={}) response = connection.post do |req| req.url "lists/#{list_id}/deleteitem", {:itemId => item_id}.merge() end return_error_or_body(response, response.body.response.item) end |
permalink #follow_list(list_id, options = {}) ⇒ Object
Follow a list: developer.foursquare.com/docs/lists/follow
37 38 39 40 41 42 |
# File 'lib/foursquare2/lists.rb', line 37 def follow_list(list_id, ={}) response = connection.post do |req| req.url "lists/#{list_id}/follow", end return_error_or_body(response, response.body.response.list) end |
permalink #list(list_id, options = {}) ⇒ Object
Retrieve information about a list.
11 12 13 14 15 16 |
# File 'lib/foursquare2/lists.rb', line 11 def list(list_id, ={}) response = connection.get do |req| req.url "lists/#{list_id}", end return_error_or_body(response, response.body.response.list) end |
permalink #move_list_item(list_id, item_id, options = {}) ⇒ Object
Move an item on a list: developer.foursquare.com/docs/lists/moveitem
109 110 111 112 113 114 |
# File 'lib/foursquare2/lists.rb', line 109 def move_list_item(list_id, item_id, ={}) response = connection.post do |req| req.url "lists/#{list_id}/moveitem", {:itemId => item_id}.merge() end return_error_or_body(response, response.body.response.list) end |
permalink #unfollow_list(list_id, options = {}) ⇒ Object
Unfollow a list: developer.foursquare.com/docs/lists/unfollow
48 49 50 51 52 53 |
# File 'lib/foursquare2/lists.rb', line 48 def unfollow_list(list_id, ={}) response = connection.post do |req| req.url "lists/#{list_id}/unfollow", end return_error_or_body(response, response.body.response.list) end |
permalink #update_list(list_id, options = {}) ⇒ Object
Update a list: developer.foursquare.com/docs/lists/update
64 65 66 67 68 69 |
# File 'lib/foursquare2/lists.rb', line 64 def update_list(list_id, ={}) response = connection.post do |req| req.url "lists/#{list_id}/update", end return_error_or_body(response, response.body.response.list) end |