Module: RicDebug

Included in:
String
Defined in:
lib/classes/debug_ric.rb

Overview

copied from Mixins in Programming ruby book, pag 119

Instance Method Summary collapse

Instance Method Details

#to_verbose_sObject



18
19
20
# File 'lib/classes/debug_ric.rb', line 18

def to_verbose_s()
  whoami?
end

#traceObject



12
13
14
15
16
# File 'lib/classes/debug_ric.rb', line 12

def trace()
  puts "== Riccardo Debug Trace program (excuse verboity) =="
  puts "File: #{__FILE__}"
  #TODO put verbose context like call stack, ...  
end

#whoami?Boolean

$stderr.puts “DEBUG: including module RicDebug, as a mixin within #RicDebug.selfself.class”

Returns:

  • (Boolean)


8
9
10
# File 'lib/classes/debug_ric.rb', line 8

def whoami?
  "#{self.class.name} (\##{self.object_id}): #{self}"
end