Sha256: 3843b172a5672dfe799147139dcd894b875cc2141c6364abcc1505eb65d301e1

Contents?: true

Size: 477 Bytes

Versions: 8

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

module Telegram
  module Bot
    module Types
      class InlineKeyboardMarkup < Base
        attribute :inline_keyboard, Array[Array[InlineKeyboardButton]]

        def to_compact_hash
          hsh = super
          hsh[:inline_keyboard].map! do |arr|
            arr.map do |item|
              item.is_a?(InlineKeyboardButton) ? 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/inline_keyboard_markup.rb
telegram-bot-ruby-0.22.0 lib/telegram/bot/types/inline_keyboard_markup.rb
telegram-bot-ruby-0.21.1 lib/telegram/bot/types/inline_keyboard_markup.rb
telegram-bot-ruby-0.21.0 lib/telegram/bot/types/inline_keyboard_markup.rb
telegram-bot-ruby-0.20.0 lib/telegram/bot/types/inline_keyboard_markup.rb
telegram-bot-ruby-0.19.2 lib/telegram/bot/types/inline_keyboard_markup.rb
telegram-bot-ruby-0.19.1 lib/telegram/bot/types/inline_keyboard_markup.rb
telegram-bot-ruby-0.19.0 lib/telegram/bot/types/inline_keyboard_markup.rb