Module: Telegram::Bot::Initializers
Instance Method Summary collapse
- #by_id(_id) ⇒ Object
-
#wrap(input, **options) ⇒ Object
Accepts different options to initialize bot.
Instance Method Details
#by_id(_id) ⇒ Object
16 17 18 |
# File 'lib/telegram/bot/initializers.rb', line 16 def by_id(_id) raise 'Not implemented' end |
#wrap(input, **options) ⇒ Object
Accepts different options to initialize bot.
7 8 9 10 11 12 13 14 |
# File 'lib/telegram/bot/initializers.rb', line 7 def wrap(input, **) 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, **) else new(input, **) end end |