Module: Mastodon::REST::Endorsements

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

Instance Method Summary collapse

Methods included from Utils

#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object

Instance Method Details

#endorse(account_id) ⇒ Mastodon::Relationship

Endorse an account (feature on own profile)


24
25
26
# File 'lib/mastodon/rest/endorsements.rb', line 24

def endorse()
  perform_request_with_object(:post, "/api/v1/accounts/#{account_id}/pin", {}, Mastodon::Relationship)
end

#endorsements(options = {}) ⇒ Mastodon::Collection<Mastodon::Account>

Get a list of endorsed accounts

Options Hash (options):

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

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

def endorsements(options = {})
  perform_request_with_collection('/api/v1/endorsements', options, Mastodon::)
end

#unendorse(account_id) ⇒ Mastodon::Relationship

Unendorse an account (no longer feature it on own profile)


31
32
33
# File 'lib/mastodon/rest/endorsements.rb', line 31

def unendorse()
  perform_request_with_object(:post, "/api/v1/accounts/#{account_id}/unpin", {}, Mastodon::Relationship)
end