Class: Little::Notification
- Inherits:
-
Object
- Object
- Little::Notification
- Defined in:
- lib/little/notification.rb
Overview
retrieve and repond to notifications
Class Method Summary collapse
-
.get(user, type) ⇒ Hash
gets the notification for a user and type.
-
.respond(user, notification_id, response) ⇒ Object
responds to a particular notification.
-
.sign_respond(user, notification_id) ⇒ Object
generates a signature for sending a response(useful when using the javascript library).
Class Method Details
.get(user, type) ⇒ Hash
gets the notification for a user and type
8 9 10 |
# File 'lib/little/notification.rb', line 8 def self.get(user, type) Little.get(:notifications, {:user => user, :type => type}) end |
.respond(user, notification_id, response) ⇒ Object
responds to a particular notification
16 17 18 |
# File 'lib/little/notification.rb', line 16 def self.respond(user, notification_id, response) Little.post(:notifications, {:user => user, :notification => notification_id, :response => response}, [:user, :notification], 'respond') end |
.sign_respond(user, notification_id) ⇒ Object
generates a signature for sending a response(useful when using the javascript library)
21 22 23 |
# File 'lib/little/notification.rb', line 21 def self.sign_respond(user, notification_id) Little.sign(:notification, {:user => user, :notification => notification_id}) end |