class Telegram::Bot::Types::ReplyKeyboardMarkup

Attributes

keyboard[RW]
one_time_keyboard[RW]
resize_keyboard[RW]
selective[RW]

Public Class Methods

new(attributes, options = {}) click to toggle source
# File lib/telegram/bot/types/reply_keyboard_markup.rb, line 5
def initialize(attributes, options = {})
  options.each { |k, v| self.send("#{k}=", v) if self.respond_to? k }

  @keyboard = attributes.map do |v|
    v.map do |b|
      if b.is_a?(KeyboardButton)
        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::KeyboardButton or Hash')
      end
    end
  end
end