Module: Kernel

Defined in:
lib/grass/core_ext/kernel.rb

Instance Method Summary collapse

Instance Method Details

#called_from(level = 1) ⇒ Object



3
4
5
6
# File 'lib/grass/core_ext/kernel.rb', line 3

def called_from(level=1)
  arrs = caller((level||1)+1)  or return
  arrs[0] =~ /:(\d+)(?::in `(.*)')?/ ? [$`, $1.to_i, $2] : nil
end