Module: Mastodon::REST::Notifications

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

Instance Method Summary collapse

Methods included from Utils

#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object

Instance Method Details

#clear_notificationsObject

Clear all notifications


29
30
31
# File 'lib/mastodon/rest/notifications.rb', line 29

def clear_notifications
  perform_request(:post, '/api/v1/notifications/clear')
end

#dismiss_notification(id) ⇒ Object

Dismiss a notification


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

def dismiss_notification(id)
  perform_request(:post, "/api/v1/notifications/#{id}/dismiss")
end

#notifications(options = {}) ⇒ Mastodon::Collection<Mastodon::Notification>

Get a list of notifications for the authenticated user

Options Hash (options):

  • :max_id (Integer)
  • :since_id (Integer)
  • :min_id (Integer)
  • :limit (Integer)
  • :exclude_types (Array<String>)

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

def notifications(options = {})
  options[:'exclude_types[]'] = options.delete(:exclude_types) if options.key?(:exclude_types)
  perform_request_with_collection(:get, '/api/v1/notifications', options, Mastodon::Notification)
end