Class: TamTam::Message
- Inherits:
-
Object
- Object
- TamTam::Message
- Defined in:
- lib/tam_tam/message.rb
Overview
An individual message. Simple wrapper around a Hash with the message data.
Instance Attribute Summary collapse
-
#data ⇒ Object
writeonly
Sets the attribute data.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(data) ⇒ Message
constructor
A new instance of Message.
- #sender ⇒ Object
- #text ⇒ Object
- #time ⇒ Object
Constructor Details
#initialize(data) ⇒ Message
Returns a new instance of Message.
7 8 9 |
# File 'lib/tam_tam/message.rb', line 7 def initialize(data) self.data = data end |
Instance Attribute Details
#data=(value) ⇒ Object
Sets the attribute data
4 5 6 |
# File 'lib/tam_tam/message.rb', line 4 def data=(value) @data = value end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 |
# File 'lib/tam_tam/message.rb', line 23 def ==(other) data == other.data end |
#sender ⇒ Object
11 12 13 |
# File 'lib/tam_tam/message.rb', line 11 def sender data[:sender] end |
#text ⇒ Object
15 16 17 |
# File 'lib/tam_tam/message.rb', line 15 def text data[:text] end |
#time ⇒ Object
19 20 21 |
# File 'lib/tam_tam/message.rb', line 19 def time data[:time] end |