Last active
May 21, 2018 14:41
-
-
Save tkfm-yamaguchi/a102d00a1852c01d7ff81ae31585d6af to your computer and use it in GitHub Desktop.
It would be nil (local variable) when a method is substituted by itself 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
"method" | |
"a" | |
"local-variable" | |
nil |
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
def a | |
'a' | |
end | |
p defined?(a) | |
p a | |
a = a | |
p defined?(a) | |
p a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
何故…