Skip to content

Instantly share code, notes, and snippets.

@pdg137
Last active January 17, 2017 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdg137/c3817327ba744e2fc337cda37809d16a to your computer and use it in GitHub Desktop.
Save pdg137/c3817327ba744e2fc337cda37809d16a to your computer and use it in GitHub Desktop.
module M
A = 1
end
module M::N
B = 2
end
class M::N::C
prepend M::N
prepend M
def self.hello
puts "A = #{A}"
puts "B = #{B}"
end
class D
def self.hello
# FAILS
puts "A = #{A}"
puts "B = #{B}"
end
end
end
M::N::C.hello
M::N::C::D.hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment