public Method

Kernel.__caller_info__(i = 1)

Gives you back the file, line and method of the caller number i

Example

__caller_info__(1) # -> ['/usr/lib/ruby/1.8/irb/workspace.rb', '52', 'irb_binding']

Source Code

# File merb/core_ext/kernel.rb, line 143
def __caller_info__(i = 1)
  file, line, meth = caller[i].scan(/(.*?):(\d+):in `(.*?)'/).first
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.