Class: MagicBell::UserNotification

Inherits:
ApiResource show all
Defined in:
lib/magicbell/api_resources/user_notification.rb

Instance Attribute Summary

Attributes inherited from ApiResource

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiResource

#attribute, #attributes, #create, create, create_path, #create_path, create_url, #create_url, find, #initialize, name, #name, #retrieve, #update, #url

Constructor Details

This class inherits a constructor from MagicBell::ApiResource

Class Method Details

.pathObject



4
5
6
# File 'lib/magicbell/api_resources/user_notification.rb', line 4

def path
  "/notifications"
end

Instance Method Details

#mark_as_readObject



13
14
15
# File 'lib/magicbell/api_resources/user_notification.rb', line 13

def mark_as_read
  UserNotificationRead.new(@client, "user_notification" => self).create
end

#mark_as_unreadObject



17
18
19
# File 'lib/magicbell/api_resources/user_notification.rb', line 17

def mark_as_unread
  UserNotificationUnread.new(@client, "user_notification" => self).create
end

#pathObject



9
10
11
# File 'lib/magicbell/api_resources/user_notification.rb', line 9

def path
  "/notifications/#{id}"
end