Module: Speculations::Debugging

Included in:
Speculations
Defined in:
lib/speculations/debugging.rb

Constant Summary collapse

S =
L43::SimpleColor

Instance Method Summary collapse

Instance Method Details

#dbg_match(msg, data) ⇒ Object



16
17
18
19
# File 'lib/speculations/debugging.rb', line 16

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

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



8
9
10
11
12
13
14
# File 'lib/speculations/debugging.rb', line 8

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

  S.putc(msg) if msg
  S.putc(3, :bold_green, subject.inspect) if subject
  rtrn || subject
end