Module: Mastodon::REST::Lists
Instance Method Summary collapse
-
#add_accounts_to_list(id, account_ids = []) ⇒ Object
Add accounts to a list.
-
#create_list(params = {}) ⇒ Mastodon::List
Create a list.
-
#delete_list(id) ⇒ Object
Delete a list.
-
#list(id) ⇒ Mastodon::List
Retrieve a list.
-
#list_accounts(id, options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of accounts on the list.
-
#lists(options = {}) ⇒ Mastodon::Collection<Mastodon::List>
Get a list of your lists.
-
#remove_accounts_from_list(id, account_ids = []) ⇒ Object
Remove accounts from list.
-
#update_list(id, params = {}) ⇒ Mastodon::List
Update a list.
Methods included from Utils
#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object
Instance Method Details
#add_accounts_to_list(id, account_ids = []) ⇒ Object
Add accounts to a list
65 66 67 |
# File 'lib/mastodon/rest/lists.rb', line 65 def add_accounts_to_list(id, account_ids = []) perform_request(:post, "/api/v1/lists/#{id}/accounts", { 'account_ids[]': account_ids }) end |
#create_list(params = {}) ⇒ Mastodon::List
Create a list
31 32 33 |
# File 'lib/mastodon/rest/lists.rb', line 31 def create_list(params = {}) perform_request_with_object(:post, '/api/v1/lists/', params, Mastodon::List) end |
#delete_list(id) ⇒ Object
Delete a list
46 47 48 |
# File 'lib/mastodon/rest/lists.rb', line 46 def delete_list(id) perform_request(:delete, "/api/v1/lists/#{id}") end |
#list(id) ⇒ Mastodon::List
Retrieve a list
23 24 25 |
# File 'lib/mastodon/rest/lists.rb', line 23 def list(id) perform_request_with_object(:get, "/api/v1/lists/#{id}", {}, Mastodon::List) end |
#list_accounts(id, options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of accounts on the list
58 59 60 |
# File 'lib/mastodon/rest/lists.rb', line 58 def list_accounts(id, = {}) perform_request_with_collection(:get, "/api/v1/lists/#{id}/accounts", , Mastodon::Account) end |
#lists(options = {}) ⇒ Mastodon::Collection<Mastodon::List>
Get a list of your lists
16 17 18 |
# File 'lib/mastodon/rest/lists.rb', line 16 def lists( = {}) perform_request_with_collection(:get, '/api/v1/lists', , Mastodon::List) end |
#remove_accounts_from_list(id, account_ids = []) ⇒ Object
Remove accounts from list
72 73 74 |
# File 'lib/mastodon/rest/lists.rb', line 72 def remove_accounts_from_list(id, account_ids = []) perform_request(:delete, "/api/v1/lists/#{id}/accounts", { 'account_ids[]': account_ids }) end |
#update_list(id, params = {}) ⇒ Mastodon::List
Update a list
40 41 42 |
# File 'lib/mastodon/rest/lists.rb', line 40 def update_list(id, params = {}) perform_request_with_object(:put, "/api/v1/lists/#{id}", params, Mastodon::List) end |