Class: TelegramOnSteroids::Keyboard::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram_on_steroids/keyboard/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keyboard:) ⇒ Row

Returns a new instance of Row.



2
3
4
5
# File 'lib/telegram_on_steroids/keyboard/row.rb', line 2

def initialize(keyboard:)
  @buttons = []
  @keyboard = keyboard
end

Instance Attribute Details

#buttonsObject (readonly)

Returns the value of attribute buttons.



11
12
13
# File 'lib/telegram_on_steroids/keyboard/row.rb', line 11

def buttons
  @buttons
end

#keyboardObject (readonly)

Returns the value of attribute keyboard.



11
12
13
# File 'lib/telegram_on_steroids/keyboard/row.rb', line 11

def keyboard
  @keyboard
end

Instance Method Details

#button(**button) ⇒ Object



7
8
9
# File 'lib/telegram_on_steroids/keyboard/row.rb', line 7

def button(**button)
  buttons.push(TelegramOnSteroids::Keyboard::Button.new(**button, keyboard:).to_telegram_format)
end