Class: Arkaan::Notification

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/arkaan/notification.rb

Overview

A notification is a little something to warn a user that an action concerning him or her occurred.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#accountArkaan::Account

Returns the account concerned by this notification.

Returns:



23
# File 'lib/arkaan/notification.rb', line 23

embedded_in :account, class_name: 'Arkaan::Account', inverse_of: :notifications

#dataHash

Returns the custom data that can be attached to this notification, for example for an invitation it can be the invited username.

Returns:

  • (Hash)

    the custom data that can be attached to this notification, for example for an invitation it can be the invited username.



19
# File 'lib/arkaan/notification.rb', line 19

field :data, type: Hash, default: {}

#readBoolean

Returns TRUE if the notification has been read (seen by the user), FALSE otherwise.

Returns:

  • (Boolean)

    TRUE if the notification has been read (seen by the user), FALSE otherwise.



15
# File 'lib/arkaan/notification.rb', line 15

field :read, type: Boolean, default: false

#typeString

Returns the type of notification this is supposed to be. All types are custom and facultative.

Returns:

  • (String)

    the type of notification this is supposed to be. All types are custom and facultative.



12
# File 'lib/arkaan/notification.rb', line 12

field :type, type: String, default: 'NOTIFICATIONS.DEFAULT'