Created
July 20, 2015 14:43
-
-
Save chrisseaton/14375725320e46bc5978 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
module ModuleSpecs | |
module A | |
CONSTANT_A = :a | |
#OVERRIDE = :a | |
#def ma(); :a; end | |
#def self.cma(); :a; end | |
end | |
module B | |
#CONSTANT_B = :b | |
#OVERRIDE = :b | |
puts 'about to include...' | |
include A | |
#def mb(); :b; end | |
#def self.cmb(); :b; end | |
end | |
#class C | |
# OVERRIDE = :c | |
# include B | |
#end | |
#module Z | |
# MODULE_SPEC_TOPLEVEL_CONSTANT = 1 | |
#end | |
end | |
p ModuleSpecs::A.constants.include?(:CONSTANT_A) | |
p ModuleSpecs::B.constants.include?(:CONSTANT_A) | |
#p ModuleSpecs::B.constants.include?(:CONSTANT_B) | |
#p ModuleSpecs::C.constants.include?(:CONSTANT_A) | |
#p ModuleSpecs::C.constants.include?(:CONSTANT_B) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment