Module: Sqrbl::CallStack
- Defined in:
- lib/sqrbl/call_stack.rb
Overview
A small set of tools for working with the call stack.
Class Method Summary collapse
-
.caller_file(caller_item) ⇒ Object
For a given entry in the call stack, get the file.
-
.caller_line(caller_item) ⇒ Object
For a given entry in the call stack, get the line number.
-
.first_non_sqrbl_caller(call_stack = caller) ⇒ Object
Find the first item on the call stack that isn’t in the Sqrbl library path.
Class Method Details
.caller_file(caller_item) ⇒ Object
For a given entry in the call stack, get the file
12 13 14 |
# File 'lib/sqrbl/call_stack.rb', line 12 def caller_file(caller_item) caller_item.split(':')[0] end |
.caller_line(caller_item) ⇒ Object
For a given entry in the call stack, get the line number
17 18 19 |
# File 'lib/sqrbl/call_stack.rb', line 17 def caller_line(caller_item) caller_item.split(':')[1] end |