Sha256: 1527f081cfcc1e663591474edd850ea1431ad33c678b7ba7702353f9639ef3f9

Contents?: true

Size: 488 Bytes

Versions: 12

Compression:

Stored size: 488 Bytes

Contents

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
telegram-bot-0.12.1 lib/telegram/bot/initializers.rb
telegram-bot-0.12.0 lib/telegram/bot/initializers.rb
telegram-bot-0.11.3 lib/telegram/bot/initializers.rb
telegram-bot-0.11.2 lib/telegram/bot/initializers.rb
telegram-bot-0.11.1 lib/telegram/bot/initializers.rb
telegram-bot-0.11.0 lib/telegram/bot/initializers.rb
telegram-bot-0.10.2 lib/telegram/bot/initializers.rb
telegram-bot-0.10.1 lib/telegram/bot/initializers.rb
telegram-bot-0.10.0 lib/telegram/bot/initializers.rb
telegram-bot-0.9.0 lib/telegram/bot/initializers.rb
telegram-bot-0.9.0.alpha2 lib/telegram/bot/initializers.rb
telegram-bot-0.9.0.alpha1 lib/telegram/bot/initializers.rb