Module: Telegram::Bot::DebugClient

Included in:
Client
Defined in:
lib/telegram/bot/debug_client.rb

Instance Method Summary collapse

Instance Method Details

#debug!(dev = $stdout) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/telegram/bot/debug_client.rb', line 6

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

#debug_off!Object



20
21
22
# File 'lib/telegram/bot/debug_client.rb', line 20

def debug_off!
  client.debug_dev = nil
end