Skip to content

Instantly share code, notes, and snippets.

@chuckha
Last active March 18, 2017 22:36
Show Gist options
  • Save chuckha/62254e5bc2b83935ff1bdd397fcd930a to your computer and use it in GitHub Desktop.
Save chuckha/62254e5bc2b83935ff1bdd397fcd930a to your computer and use it in GitHub Desktop.
wat
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
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