module Mastodon::REST::Instances

Public Instance Methods

block_domain(domain) click to toggle source

Block a domain @param domain [String] @return [Boolean]

# 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 = {}) click to toggle source

Get user domain blocks @param options [Hash] @option options :limit [Integer] @return [Mastodon::Collection<String>]

# File lib/mastodon/rest/instances.rb, line 22
def domain_blocks(options = {})
  perform_request_with_collection(:get, '/api/v1/domain_blocks',
                                  options, String)
end
instance() click to toggle source

Retrieve the current instance. Does not require authentication @return [Mastodon::Instance]

# File lib/mastodon/rest/instances.rb, line 13
def instance
  perform_request_with_object(:get, '/api/v1/instance', {},
                              Mastodon::Instance)
end
unblock_domain(domain) click to toggle source

Unblock a domain @param domain [String] @return [Boolean]

# File lib/mastodon/rest/instances.rb, line 38
def unblock_domain(domain)
  !perform_request(:delete, '/api/v1/domain_blocks',
                   { domain: domain }).nil?
end