Created
August 8, 2017 05:10
-
-
Save hkurokawa/bd26ca9628eb503ef1f2ce01fda248da to your computer and use it in GitHub Desktop.
This file contains hidden or 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 A | |
FOO = 'foo' | |
end | |
class B < A | |
def self.foo | |
p FOO | |
end | |
class << self | |
def foo2 | |
p self::FOO # it doesn't compile without self::! | |
end | |
end | |
end | |
B.foo | |
B.foo2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment