Module: Telegram::Bot::UpdatesController::TypedUpdate

Defined in:
lib/telegram/bot/updates_controller/typed_update.rb

Overview

Include this module to type cast update to Virtus model using ‘telegram-bot-types` gem (install this gem first).

Instance Method Summary collapse

Instance Method Details

#initialize(bot = nil, update = nil) ⇒ Object



7
8
9
10
# File 'lib/telegram/bot/updates_controller/typed_update.rb', line 7

def initialize(bot = nil, update = nil)
  update = Types::Update.new(update) if update && !update.is_a?(Types::Update)
  super
end