Created
November 4, 2013 20:34
-
-
Save anonymous/7308802 to your computer and use it in GitHub Desktop.
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
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