Module: Kernel

Defined in:
lib/debugging.rb

Instance Method Summary collapse

Instance Method Details

#dbg_match(msg, lnb, debug:) ⇒ Object



13
14
15
16
# File 'lib/debugging.rb', line 13

def dbg_match(msg, lnb, debug:)
  designation = name.split("::").last.downcase
  debug__(msg: "#{lnb.succ}: #{msg} match in :#{designation}", debug:)
end

#debug__(subject = nil, msg: nil, rtrn: nil, debug:) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/debugging.rb', line 5

def debug__(subject=nil, msg: nil, rtrn: nil, debug:)
  return rtrn || subject unless debug

  $stderr.puts(msg) if msg
  $stderr.puts(subject.inspect) if subject
  rtrn || subject
end