Sha256: 6ef289c005de1bebf186d354972afcdcd70aa92033f4ec19d33142e466fbb5cd

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

module Telegram
  module Bot
    module Types
      class ReplyKeyboardMarkup < Base
        attribute :keyboard, Types::Array.of(Types::Array.of(KeyboardButton))
        attribute? :resize_keyboard, Types::Bool.default(false)
        attribute? :one_time_keyboard, Types::Bool.default(false)
        attribute? :input_field_placeholder, Types::String
        attribute? :selective, Types::Bool.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-1.0.0.pre lib/telegram/bot/types/reply_keyboard_markup.rb