Sha256: 3ed9bc3d5ac0cf45a5e1dcd32c0970447f8f2adb51469aab5872029234906d31

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

module Telegram
  module Bot
    class UpdatesController
      # Include this module to type cast update to Virtus model
      # using `telegram-bot-types` gem (install this gem first).
      module TypedUpdate
        def initialize(bot = nil, update = nil, webhook_request = nil)
          update = Types::Update.new(update) if update && !update.is_a?(Types::Update)
          super
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
telegram-bot-0.16.5 lib/telegram/bot/updates_controller/typed_update.rb
telegram-bot-0.16.4 lib/telegram/bot/updates_controller/typed_update.rb
telegram-bot-0.16.3 lib/telegram/bot/updates_controller/typed_update.rb