Sha256: b5a811b3e0cb65a4a2ee62b7ddb5b950074c77b810d99642d6053ca9fa6e4970

Contents?: true

Size: 717 Bytes

Versions: 6

Compression:

Stored size: 717 Bytes

Contents

module Telegram
  module Bot
    module Types
      class Update < Base
        attribute :update_id, Integer
        attribute :message, Message
        attribute :edited_message, Message
        attribute :channel_post, Message
        attribute :edited_channel_post, Message
        attribute :inline_query, InlineQuery
        attribute :chosen_inline_result, ChosenInlineResult
        attribute :callback_query, CallbackQuery
        attribute :shipping_query, ShippingQuery
        attribute :pre_checkout_query, PreCheckoutQuery

        def current_message
          @current_message ||=
            Hash[*attributes.find { |k, v| k != :update_id && v }].values.first
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
dialog_bot_ruby-0.8.8 lib/telegram/bot/types/update.rb
dialog_bot_ruby-0.8.7 lib/telegram/bot/types/update.rb
telegram-bot-ruby-0.8.6.1 lib/telegram/bot/types/update.rb
telegram-bot-ruby-0.8.6 lib/telegram/bot/types/update.rb
telegram-bot-ruby-0.8.5 lib/telegram/bot/types/update.rb
telegram-bot-ruby-0.8.4 lib/telegram/bot/types/update.rb