Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2013 20:34
Show Gist options
  • Save anonymous/7308802 to your computer and use it in GitHub Desktop.
Save anonymous/7308802 to your computer and use it in GitHub Desktop.
class K
def initialize
other_method
end
def other_method
yet_another_method
end
def yet_another_method
puts caller[0][/`.*'/][1..-2]
end
end
k = K.new
other_method # << I want this to say yet_another_method. How do I do that?
=> #<K:0x288fde0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment