Last active
March 18, 2017 22:36
-
-
Save chuckha/62254e5bc2b83935ff1bdd397fcd930a to your computer and use it in GitHub Desktop.
wat
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
module A | |
x = 1 | |
class B | |
def get_x | |
A::x #HOW DO I GET x in this scope why is ruby confusing me | |
end | |
end | |
end |
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
module A | |
def self.get_count | |
@count ||= 1 | |
end | |
class B | |
def get_x | |
A::get_count | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment