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) ⇒ Object
Delete an item from a list: developer.foursquare.com/docs/lists/deleteitem.
-
#follow_list(list_id) ⇒ 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) ⇒ 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
#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 |
#add_list_item(list_id, options = {}) ⇒ Object
Add an item to a list: developer.foursquare.com/docs/lists/additem
78 79 80 81 82 83 |
# File 'lib/foursquare2/lists.rb', line 78 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 |
#delete_list_item(list_id, item_id) ⇒ Object
Delete an item from a list: developer.foursquare.com/docs/lists/deleteitem
90 91 92 93 94 95 |
# File 'lib/foursquare2/lists.rb', line 90 def delete_list_item(list_id, item_id) response = connection.post do |req| req.url "lists/#{list_id}/deleteitem", :itemId => item_id end return_error_or_body(response, response.body.response.item) end |
#follow_list(list_id) ⇒ Object
Follow a list: developer.foursquare.com/docs/lists/follow
37 38 39 40 |
# File 'lib/foursquare2/lists.rb', line 37 def follow_list(list_id) response = connection.post "lists/#{list_id}/follow" return_error_or_body(response, response.body.response.list) end |
#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 |
#move_list_item(list_id, item_id, options = {}) ⇒ Object
Move an item on a list: developer.foursquare.com/docs/lists/moveitem
105 106 107 108 109 110 |
# File 'lib/foursquare2/lists.rb', line 105 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 |
#unfollow_list(list_id) ⇒ Object
Unfollow a list: developer.foursquare.com/docs/lists/unfollow
46 47 48 49 |
# File 'lib/foursquare2/lists.rb', line 46 def unfollow_list(list_id) response = connection.post "lists/#{list_id}/unfollow" return_error_or_body(response, response.body.response.list) end |
#update_list(list_id, options = {}) ⇒ Object
Update a list: developer.foursquare.com/docs/lists/update
60 61 62 63 64 65 |
# File 'lib/foursquare2/lists.rb', line 60 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 |