Sha256: 0112f6a07bf01c2c4fba195d9613f888c8651858ccd9ccb7c0074caad6421b58
Contents?: true
Size: 862 Bytes
Versions: 2
Compression:
Stored size: 862 Bytes
Contents
require 'facets/binding/eval' require 'facets/binding/callstack' class Binding # Returns the call stack, same format as Kernel#caller() def caller( skip=0 ) eval("caller(#{skip})") end # Returns line number. def __LINE__ eval("__LINE__") end # Returns file name. def __FILE__ eval("__FILE__") end # Return the directory of the file. def __DIR__ eval("File.dirname(__FILE__)") end # Retreive the current running method. # # def tester; p called; end # tester #=> :tester # def __callee__ eval('__callee__') end # There is a lot of debate on what to call this. # +method_name+ differs from #called only by the fact # that it returns a string, rather then a symbol. # # def tester; p methodname; end # tester #=> "tester" # def __method__ eval('__method__') end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
facets-2.8.1 | lib/core/facets/binding/caller.rb |
facets-2.8.0 | lib/core/facets/binding/caller.rb |