Created
December 14, 2012 18:43
-
-
Save anonymous/4287593 to your computer and use it in GitHub Desktop.
ruby 2.0 OO backtrace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[8] pry(main)> caller_locations | |
=> [#<RubyVM::Backtrace::Location:0x007f782e9d24e0>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d24b8>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2468>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2418>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d23a0>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2350>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2328>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2300>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d22d8>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d22b0>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2260>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2210>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d21c0>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2198>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2170>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2148>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d2120>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d20f8>, | |
#<RubyVM::Backtrace::Location:0x007f782e9d20d0>] | |
[9] pry(main)> b = _[5] | |
=> #<RubyVM::Backtrace::Location:0x007f782e9d2350> | |
[10] pry(main)> ls -m b | |
RubyVM::Backtrace::Location#methods: absolute_path base_label label lineno path to_s | |
[11] pry(main)> b.label | |
=> "block (2 levels) in repl" | |
[12] pry(main)> b.base_label | |
=> "repl" | |
[13] pry(main)> b.lineno | |
=> 232 | |
[14] pry(main)> b.path | |
=> "/home/john/.rbenv/versions/debug_api2/lib/ruby/gems/2.0.0/gems/pry-0.9.10/lib/pry/pry_instance.rb" | |
[15] pry(main)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment