Module: Mastodon::REST::Filters
Instance Method Summary collapse
-
#create_filter(params = {}) ⇒ Mastodon::Filter
Create a filter.
-
#delete_filter(id) ⇒ Object
Delete a filter.
-
#filter(id) ⇒ Mastodon::Filter
Retrieve a filter.
-
#filters(options = {}) ⇒ Mastodon::Collection<Mastodon::Filter>
Get a list of filters.
-
#update_filter(id, params = {}) ⇒ Mastodon::Filter
Update a filter.
Methods included from Utils
#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object
Instance Method Details
#create_filter(params = {}) ⇒ Mastodon::Filter
Create a filter
35 36 37 38 |
# File 'lib/mastodon/rest/filters.rb', line 35 def create_filter(params = {}) params[:'context[]'] = params.delete(:context) if params.key?(:context) perform_request_with_object(:post, '/api/v1/filters', params, Mastodon::Filter) end |
#delete_filter(id) ⇒ Object
Delete a filter
56 57 58 |
# File 'lib/mastodon/rest/filters.rb', line 56 def delete_filter(id) perform_request(:delete, "/api/v1/filters/#{id}") end |
#filter(id) ⇒ Mastodon::Filter
Retrieve a filter
23 24 25 |
# File 'lib/mastodon/rest/filters.rb', line 23 def filter(id) perform_request_with_object(:put, "/api/v1/filters/#{id}", {}, Mastodon::Filter) end |
#filters(options = {}) ⇒ Mastodon::Collection<Mastodon::Filter>
Get a list of filters
16 17 18 |
# File 'lib/mastodon/rest/filters.rb', line 16 def filters( = {}) perform_request_with_collection('/api/v1/filters', , Mastodon::Filter) end |
#update_filter(id, params = {}) ⇒ Mastodon::Filter
Update a filter
49 50 51 52 |
# File 'lib/mastodon/rest/filters.rb', line 49 def update_filter(id, params = {}) params[:'context[]'] = params.delete(:context) if params.key?(:context) perform_request_with_object(:put, "/api/v1/filters/#{id}", params, Mastodon::Filter) end |