Sha256: ad77f1b9092450594efad1304173edc866c24fac07dd72c0fdeffefcee173650

Contents?: true

Size: 747 Bytes

Versions: 5

Compression:

Stored size: 747 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
        attribute :poll, Poll

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
telegram-bot-ruby-0.11.0 lib/telegram/bot/types/update.rb
telegram-bot-ruby-0.10.1 lib/telegram/bot/types/update.rb
telegram-bot-ruby-0.10.0 lib/telegram/bot/types/update.rb
telegram-bot-ruby-0.9.1 lib/telegram/bot/types/update.rb
telegram-bot-ruby-0.9.0 lib/telegram/bot/types/update.rb