Module: Mastodon::REST::Instances
Instance Method Summary collapse
-
#block_domain(domain) ⇒ Boolean
Block a domain.
-
#domain_blocks(options = {}) ⇒ Mastodon::Collection<String>
Get user domain blocks.
-
#instance ⇒ Mastodon::Instance
Retrieve the current instance.
-
#unblock_domain(domain) ⇒ Boolean
Unblock a domain.
Methods included from Utils
#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object
Instance Method Details
#block_domain(domain) ⇒ Boolean
Block a domain
30 31 32 33 |
# File 'lib/mastodon/rest/instances.rb', line 30 def block_domain(domain) !perform_request(:post, '/api/v1/domain_blocks', { domain: domain }).nil? end |
#domain_blocks(options = {}) ⇒ Mastodon::Collection<String>
Get user domain blocks
22 23 24 25 |
# File 'lib/mastodon/rest/instances.rb', line 22 def domain_blocks( = {}) perform_request_with_collection(:get, '/api/v1/domain_blocks', , String) end |
#instance ⇒ Mastodon::Instance
Retrieve the current instance. Does not require authentication
13 14 15 16 |
# File 'lib/mastodon/rest/instances.rb', line 13 def instance perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance) end |
#unblock_domain(domain) ⇒ Boolean
Unblock a domain
38 39 40 41 |
# File 'lib/mastodon/rest/instances.rb', line 38 def unblock_domain(domain) !perform_request(:delete, '/api/v1/domain_blocks', { domain: domain }).nil? end |