Class: ICQ::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj, *keyboard) ⇒ Message

Returns a new instance of Message.



8
9
10
11
# File 'lib/icqbot/message.rb', line 8

def initialize obj, *keyboard
  @text = obj
  @keyboard = keyboard
end

Instance Attribute Details

#keyboardObject (readonly)

Returns the value of attribute keyboard.



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

def keyboard
  @keyboard
end

#textObject (readonly)

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#<<(btn) ⇒ Object Also known as: append



13
14
15
16
# File 'lib/icqbot/message.rb', line 13

def << btn
  return @keyboard << btn if btn.is_a? ICQ::Button
  raise ArgumentError.new 'btn must be a Button'
end