Sha256: f1a99c0a2441f9d3c5dd84830f8f727a0060b370c70cdd4798bfc97600f33113

Contents?: true

Size: 677 Bytes

Versions: 8

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true

module Telegram
  module Bot
    module Types
      class ReplyKeyboardMarkup < Base
        attribute :keyboard, Array[Array[KeyboardButton]]
        attribute :resize_keyboard, Boolean, default: false
        attribute :one_time_keyboard, Boolean, default: false
        attribute :input_field_placeholder, String
        attribute :selective, Boolean, default: false

        def to_compact_hash
          hsh = super
          hsh[:keyboard].map! do |arr|
            arr.map do |item|
              item.is_a?(KeyboardButton) ? item.to_compact_hash : item
            end
          end

          hsh
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
telegram-bot-ruby-0.23.0 lib/telegram/bot/types/reply_keyboard_markup.rb
telegram-bot-ruby-0.22.0 lib/telegram/bot/types/reply_keyboard_markup.rb
telegram-bot-ruby-0.21.1 lib/telegram/bot/types/reply_keyboard_markup.rb
telegram-bot-ruby-0.21.0 lib/telegram/bot/types/reply_keyboard_markup.rb
telegram-bot-ruby-0.20.0 lib/telegram/bot/types/reply_keyboard_markup.rb
telegram-bot-ruby-0.19.2 lib/telegram/bot/types/reply_keyboard_markup.rb
telegram-bot-ruby-0.19.1 lib/telegram/bot/types/reply_keyboard_markup.rb
telegram-bot-ruby-0.19.0 lib/telegram/bot/types/reply_keyboard_markup.rb