Class: Daneel::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/daneel/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject

Returns the value of attribute args.



6
7
8
# File 'lib/daneel/message.rb', line 6

def args
  @args
end

#commandObject

Returns the value of attribute command.



5
6
7
# File 'lib/daneel/message.rb', line 5

def command
  @command
end

#doneObject (readonly)

Returns the value of attribute done.



5
6
7
# File 'lib/daneel/message.rb', line 5

def done
  @done
end

#roomObject (readonly)

Returns the value of attribute room.



5
6
7
# File 'lib/daneel/message.rb', line 5

def room
  @room
end

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/daneel/message.rb', line 5

def text
  @text
end

#timeObject (readonly)

Returns the value of attribute time.



5
6
7
# File 'lib/daneel/message.rb', line 5

def time
  @time
end

#typeObject (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

#inspectObject



23
24
25
# File 'lib/daneel/message.rb', line 23

def inspect
  "#<#{self.class} #{text.inspect} #{time.inspect} #{type.inspect}>"
end