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
14 15 16 |
# File 'lib/telegram/bot/initializers.rb', line 14 def by_id(_id) raise 'Not implemented' end |
#wrap(input, **options) ⇒ Object
Accepts different options to initialize bot.
5 6 7 8 9 10 11 12 |
# File 'lib/telegram/bot/initializers.rb', line 5 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 |