Module: DList::User::Notifications
- Included in:
- Client
- Defined in:
- lib/dblista/user/notifications.rb
Overview
User client - notifications
Instance Method Summary collapse
-
#clear_notifications ⇒ Boolean
Clears user notifications.
-
#notifications ⇒ Hash
Fetches user notifications.
-
#send_group_notification(rank, details, url = '#') ⇒ Boolean
Sends notification to specified group (rank) Available only for DList staff.
-
#send_notification(id, details, url = '#') ⇒ Boolean
Sends notification to specified user Available only for DList staff.
Instance Method Details
#clear_notifications ⇒ Boolean
Clears user notifications
16 17 18 19 |
# File 'lib/dblista/user/notifications.rb', line 16 def clear_notifications DList._get('/users/me/notifications/clear', @token) true end |
#notifications ⇒ Hash
Fetches user notifications
9 10 11 |
# File 'lib/dblista/user/notifications.rb', line 9 def notifications DList._get('/users/me/notifications/read', @token) end |
#send_group_notification(rank, details, url = '#') ⇒ Boolean
Sends notification to specified group (rank) Available only for DList staff
44 45 46 47 48 49 50 |
# File 'lib/dblista/user/notifications.rb', line 44 def send_group_notification(rank, details, url = '#') DList._post("/users/group/#{rank}/notifications", { text: details, url: url || '#' }, @token) true end |
#send_notification(id, details, url = '#') ⇒ Boolean
Sends notification to specified user Available only for DList staff
28 29 30 31 32 33 34 35 |
# File 'lib/dblista/user/notifications.rb', line 28 def send_notification(id, details, url = '#') DList._validate_id id DList._post("/users/#{id}/notifications", { text: details, url: url || '#' }, @token) true end |