Created
September 24, 2009 15:32
-
-
Save jasonmadigan/192810 to your computer and use it in GitHub Desktop.
Caller execution stack frame in Ruby
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
#!/usr/bin/ruby | |
# Kernel#caller returns the current execution stack | |
class Stubby | |
def initialize | |
puts caller | |
end | |
end | |
stub = Stubby.new | |
# => ./caller.rb:11:in `new' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment