1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-01 17:06:19 +03:00
Files
telegram-bot/lib/telegram/bot/initializers.rb
2016-08-09 16:07:21 +06:00

20 строки
488 B
Ruby

module Telegram
module Bot
module Initializers
# Accepts different options to initialize bot.
def wrap(input, **options)
case input
when Symbol then by_id(input) or raise "#{name} #{input.inspect} not configured"
when self then input
when Hash then new(**input.symbolize_keys, **options)
else new(input, **options)
end
end
def by_id(_id)
raise 'Not implemented'
end
end
end
end