Skip to content

Instantly share code, notes, and snippets.

@jasonmadigan
Created September 24, 2009 15:32
Show Gist options
  • Save jasonmadigan/192810 to your computer and use it in GitHub Desktop.
Save jasonmadigan/192810 to your computer and use it in GitHub Desktop.
Caller execution stack frame in Ruby
#!/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