Class: Daneel::Message
- Inherits:
-
Object
- Object
- Daneel::Message
- Defined in:
- lib/daneel/message.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#command ⇒ Object
Returns the value of attribute command.
-
#done ⇒ Object
readonly
Returns the value of attribute done.
-
#room ⇒ Object
readonly
Returns the value of attribute room.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #done! ⇒ Object
-
#initialize(text, time = Time.now, type = :text) ⇒ Message
constructor
A new instance of Message.
- #inspect ⇒ Object
Constructor Details
#initialize(text, time = Time.now, type = :text) ⇒ Message
Returns a new instance of Message.
8 9 10 |
# File 'lib/daneel/message.rb', line 8 def initialize(text, time = Time.now, type = :text) @text, @time, @type = text, time, type end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
6 7 8 |
# File 'lib/daneel/message.rb', line 6 def args @args end |
#command ⇒ Object
Returns the value of attribute command.
5 6 7 |
# File 'lib/daneel/message.rb', line 5 def command @command end |
#done ⇒ Object (readonly)
Returns the value of attribute done.
5 6 7 |
# File 'lib/daneel/message.rb', line 5 def done @done end |
#room ⇒ Object (readonly)
Returns the value of attribute room.
5 6 7 |
# File 'lib/daneel/message.rb', line 5 def room @room end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/daneel/message.rb', line 5 def text @text end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/daneel/message.rb', line 5 def time @time end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/daneel/message.rb', line 5 def type @type end |
Instance Method Details
#done! ⇒ Object
19 20 21 |
# File 'lib/daneel/message.rb', line 19 def done! @done = true end |
#inspect ⇒ Object
23 24 25 |
# File 'lib/daneel/message.rb', line 23 def inspect "#<#{self.class} #{text.inspect} #{time.inspect} #{type.inspect}>" end |