Class: Turntabler::Message
- Defined in:
- lib/turntabler/message.rb
Overview
Represents a message that was sent to or from the current user. This can either be within the context of a room or a private conversation.
Instance Attribute Summary collapse
-
#content ⇒ String
readonly
The text of the message.
-
#created_at ⇒ Time
readonly
The time at which the message was created.
-
#sender ⇒ Turntabler::User
readonly
The user who sent the message.
Attributes inherited from Resource
Method Summary
Methods inherited from Resource
#==, attribute, #attributes=, #hash, #initialize, #load, #loaded?, #pretty_print, #pretty_print_instance_variables
Methods included from Assertions
#assert_valid_keys, #assert_valid_values
Methods included from DigestHelpers
Constructor Details
This class inherits a constructor from Turntabler::Resource
Instance Attribute Details
#content ⇒ String (readonly)
The text of the message
16 |
# File 'lib/turntabler/message.rb', line 16 attribute :content, :text |
#created_at ⇒ Time (readonly)
The time at which the message was created
20 21 22 |
# File 'lib/turntabler/message.rb', line 20 attribute :created_at, :time do |value| Time.at(value) end |
#sender ⇒ Turntabler::User (readonly)
The user who sent the message
10 11 12 |
# File 'lib/turntabler/message.rb', line 10 attribute :sender, :senderid do |id| room? ? room.build_user(:_id => id) : User.new(client, :_id => id) end |