class MagicBell::User

Attributes

email[R]

Public Class Methods

new(client, attributes) click to toggle source
Calls superclass method MagicBell::ApiResource::new
# File lib/magicbell/api_resources/user.rb, line 7
def initialize(client, attributes)
  @client = client
  @email = attributes["email"]
  super(client, attributes)
end

Public Instance Methods

authentication_headers() click to toggle source
# File lib/magicbell/api_resources/user.rb, line 46
def authentication_headers
  MagicBell.authentication_headers.merge("X-MAGICBELL-USER-EMAIL" => email)
end
find_notification(notification_id) click to toggle source
# File lib/magicbell/api_resources/user.rb, line 18
def find_notification(notification_id)
  client = self
  MagicBell::UserNotification.find(client, notification_id)
end
mark_all_notifications_as_read() click to toggle source
# File lib/magicbell/api_resources/user.rb, line 23
def mark_all_notifications_as_read
  client = self
  MagicBell::UserNotificationsRead.new(client).create
end
mark_all_notifications_as_seen() click to toggle source
# File lib/magicbell/api_resources/user.rb, line 28
def mark_all_notifications_as_seen
  client = self
  MagicBell::UserNotificationsSeen.new(client).create
end
notification_preferences() click to toggle source
# File lib/magicbell/api_resources/user.rb, line 33
def notification_preferences
  client = self
  MagicBell::UserNotificationPreferences.new(client)
end
notifications(query_params = {}) click to toggle source
# File lib/magicbell/api_resources/user.rb, line 13
def notifications(query_params = {})
  client = self
  MagicBell::UserNotifications.new(client, query_params)
end
path() click to toggle source
# File lib/magicbell/api_resources/user.rb, line 38
def path
  if id
    self.class.path + "/#{id}"
  elsif email
    self.class.path + "/email:#{email}"
  end
end