Sha256: 39f182355e905f9318e1fcc6e46ef502d60273d58d3069ef8f6d1e8b2de00617

Contents?: true

Size: 646 Bytes

Versions: 1

Compression:

Stored size: 646 Bytes

Contents

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

1 entries across 1 versions & 1 rubygems

Version Path
telegram-bot-ruby-0.18.0 lib/telegram/bot/types/reply_keyboard_markup.rb