Module: Mastodon::REST::Instances

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

Instance Method Summary collapse

Methods included from Utils

#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object

Instance Method Details

#activityMastodon::Collection<Hash>

Retrieve activity statistics for the current instance. Does not require authentication

Returns:



17
18
19
# File 'lib/mastodon/rest/instances.rb', line 17

def activity
  perform_request_with_collection(:get, '/api/v1/instance/activity', {}, Hash)
end

#instanceMastodon::Instance

Retrieve the current instance. Does not require authentication

Returns:



11
12
13
# File 'lib/mastodon/rest/instances.rb', line 11

def instance
  perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)
end

#peersMastodon::Collection<String>

Retrieve domains of instances known to the current instance. Does not require authentication

Returns:



23
24
25
# File 'lib/mastodon/rest/instances.rb', line 23

def peers
  perform_request_with_collection(:get, '/api/v1/instance/peers', {}, String)
end