Sha256: be08e824c879b8cef0e051b7e3ff50565342126d4f08850f06f376c04df3ff9c

Contents?: true

Size: 466 Bytes

Versions: 3

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

module Telegram
  module Bot
    module DebugClient
      def debug!(dev = $stdout)
        if block_given?
          begin
            old_dev = client.debug_dev
            client.debug_dev = dev
            yield
          ensure
            client.debug_dev = old_dev
          end
        else
          client.debug_dev = dev
        end
      end

      def debug_off!
        client.debug_dev = nil
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
telegram-bot-0.16.5 lib/telegram/bot/debug_client.rb
telegram-bot-0.16.4 lib/telegram/bot/debug_client.rb
telegram-bot-0.16.3 lib/telegram/bot/debug_client.rb