-
-
Save shugo/2425611 to your computer and use it in GitHub Desktop.
定数探索もそれっぽく動いてる #mruby
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 | |
X = "A::X" | |
Y = "A::Y" | |
Z = "A::Z" | |
end | |
module B | |
Y = "B::Y" | |
class C < A | |
Z = "C::Z" | |
def show_constants | |
p X | |
p Y | |
p Z | |
end | |
end | |
end | |
c = B::C.new | |
c.show_constants |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment