Class: Arkaan::Campaigns::Message
- Inherits:
-
Object
- Object
- Arkaan::Campaigns::Message
- Includes:
- Arkaan::Concerns::Enumerable, Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/arkaan/campaigns/message.rb
Overview
This model represents an in-game tchat message sent in the tchat of a campaign.
Instance Attribute Summary collapse
-
#campaign ⇒ Arkaan::Campaign
The campaign in which the message has been emitted.
-
#data ⇒ Hash
The additional data passed to the message (arguments of the command, or content of the text).
-
#deleted ⇒ Boolean
TRUE if the message has been marked as deleted by its user, FALSE otherwise.
-
#player ⇒ Arkaan::Account
The account that has emitted the message in the campaign.
-
#type ⇒ Symbol
The type of message (plain text or command) contained in the data, used to parse and display it.
Instance Attribute Details
#campaign ⇒ Arkaan::Campaign
Returns the campaign in which the message has been emitted.
22 |
# File 'lib/arkaan/campaigns/message.rb', line 22 :campaign, class_name: 'Arkaan::Campaign', inverse_of: :messages |
#data ⇒ Hash
Returns the additional data passed to the message (arguments of the command, or content of the text).
15 |
# File 'lib/arkaan/campaigns/message.rb', line 15 field :data, type: Hash, default: {} |
#deleted ⇒ Boolean
Returns TRUE if the message has been marked as deleted by its user, FALSE otherwise.
18 |
# File 'lib/arkaan/campaigns/message.rb', line 18 field :deleted, type: Boolean, default: false |
#player ⇒ Arkaan::Account
Returns the account that has emitted the message in the campaign.
25 |
# File 'lib/arkaan/campaigns/message.rb', line 25 belongs_to :player, class_name: 'Arkaan::Campaigns::Invitation' |
#type ⇒ Symbol
Returns the type of message (plain text or command) contained in the data, used to parse and display it.
12 |
# File 'lib/arkaan/campaigns/message.rb', line 12 enum_field :type, [:text, :command], default: :text |