Module: Doodle::Debug

Defined in:
lib/doodle/debug.rb

Overview

debugging utilities

Class Method Summary collapse

Class Method Details

.calling_method(level = 1) ⇒ Object

Robert Klemme, (ruby-talk 205150), (ruby-talk 205950)



6
7
8
# File 'lib/doodle/debug.rb', line 6

def calling_method(level = 1)
  caller[level] =~ /`([^']*)'/ and $1
end

.d(&block) ⇒ Object

output result of block if ENV set



15
16
17
# File 'lib/doodle/debug.rb', line 15

def d(&block)
  puts(calling_method + ": " + block.call.inspect) if ENV['DEBUG_DOODLE']
end

.this_methodObject



10
11
12
# File 'lib/doodle/debug.rb', line 10

def this_method
  calling_method
end