Module: CallerInfo

Included in:
BIFFWriter
Defined in:
lib/writeexcel/caller_info.rb

Instance Method Summary collapse

Instance Method Details

#caller_infoObject

return stack trace info if defined?($debug).


6
7
8
9
10
11
# File 'lib/writeexcel/caller_info.rb', line 6

def caller_info
  caller(3).collect { |info|
    file = File.expand_path(info.sub(/:(\d+)[^\d`]*(`([^']+)')?/, ''))
    { :file => file, :line => $1, :method => $3 }
  }.select { |info| info[:method] }  # delete if info[:method] == nil
end