Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2013 20:34
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