Module: Mastodon::REST::Endorsements
Instance Method Summary collapse
-
#endorse(account_id) ⇒ Mastodon::Relationship
Endorse an account (feature on own profile).
-
#endorsements(options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of endorsed accounts.
-
#unendorse(account_id) ⇒ Mastodon::Relationship
Unendorse an account (no longer feature it on own profile).
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(account_id) 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
17 18 19 |
# File 'lib/mastodon/rest/endorsements.rb', line 17 def endorsements( = {}) perform_request_with_collection('/api/v1/endorsements', , Mastodon::Account) 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(account_id) perform_request_with_object(:post, "/api/v1/accounts/#{account_id}/unpin", {}, Mastodon::Relationship) end |