Class: Core::Models::Notification
- Inherits:
-
Object
- Object
- Core::Models::Notification
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/core/models/notification.rb
Overview
A notification is a little something to warn a user that an action concerning him or her occurred.
Instance Attribute Summary collapse
-
#account ⇒ Core::Models::Account
The account concerned by this notification.
-
#data ⇒ Hash
The custom data that can be attached to this notification, for example for an invitation it can be the invited username.
-
#read ⇒ Boolean
TRUE if the notification has been read (seen by the user), FALSE otherwise.
-
#type ⇒ String
The type of notification this is supposed to be.
Instance Attribute Details
#account ⇒ Core::Models::Account
Returns the account concerned by this notification.
21 |
# File 'lib/core/models/notification.rb', line 21 :account, class_name: 'Core::Models::Account', inverse_of: :notifications |
#data ⇒ Hash
Returns the custom data that can be attached to this notification, for example for an invitation it can be the invited username.
17 |
# File 'lib/core/models/notification.rb', line 17 field :data, type: Hash, default: {} |
#read ⇒ Boolean
Returns TRUE if the notification has been read (seen by the user), FALSE otherwise.
14 |
# File 'lib/core/models/notification.rb', line 14 field :read, type: Mongoid::Boolean, default: false |
#type ⇒ String
Returns the type of notification this is supposed to be. All types are custom and facultative.
11 |
# File 'lib/core/models/notification.rb', line 11 field :type, type: String, default: 'NOTIFICATIONS.DEFAULT' |