Module: Mastodon::REST::DomainBlocks

Includes:
Utils
Included in:
API
Defined in:
lib/mastodon/rest/domain_blocks.rb

Instance Method Summary collapse

Methods included from Utils

#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object

Instance Method Details

#block_domain(domain) ⇒ Object

Block a domain

Parameters:

  • domain (String)


21
22
23
# File 'lib/mastodon/rest/domain_blocks.rb', line 21

def block_domain(domain)
  perform_request(:post, '/api/v1/domain_blocks', domain: domain)
end

#domain_blocks(options = {}) ⇒ Mastodon::Collection<String>

Get a list of blocked domains

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :max_id (Integer)
  • :since_id (Integer)
  • :min_id (Integer)
  • :limit (Integer)

Returns:



15
16
17
# File 'lib/mastodon/rest/domain_blocks.rb', line 15

def domain_blocks(options = {})
  perform_request_with_collection('/api/v1/domain_blocks', options, String)
end

#unblock_domain(domain) ⇒ Object

Unblock a domain

Parameters:

  • domain (String)


27
28
29
# File 'lib/mastodon/rest/domain_blocks.rb', line 27

def unblock_domain(domain)
  perform_request(:delete, '/api/v1/domain_blocks', domain: domain)
end