Class: Telegram::Bot::Types::InlineKeyboardMarkup

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram/bot/types/inline_keyboard_markup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ InlineKeyboardMarkup

Returns a new instance of InlineKeyboardMarkup.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/telegram/bot/types/inline_keyboard_markup.rb', line 5

def initialize(attributes)
  @inline_keyboard = attributes.map do |v|
    v.map do |b|
      if b.is_a?(InlineKeyboardButton)
        b
      elsif b.is_a?(Hash)
        InlineKeyboardButton.new(b)
      else
        raise Telegram::Bot::KeyboardMarkupError.new(
            'Attributes must be Array of Array of Telegram::Bot::Types::InlineKeyboardButton or Hash'
        )
      end
    end
  end
end

Instance Attribute Details

#inline_keyboardObject

Returns the value of attribute inline_keyboard.



3
4
5
# File 'lib/telegram/bot/types/inline_keyboard_markup.rb', line 3

def inline_keyboard
  @inline_keyboard
end