P
Prince Nez
module M1; end
module M2; include M1; end
module M1; DOG = :woof; end
module M2; DOG; end
# => :woof
I can add to a module after it has been included. Neat.
module M1; DOG = :woof; end
module M2; include M1; end
module M3; include M2; end
module M3; DOG; end
# => :woof
Including a module seems to give me any modules that it includes. Swish.
module M2; end
module M3; include M2; end
module M1; DOG = :woof; end
module M2; include M1; end
module M3; DOG; end
# => NameError: uninitialized constant M3:
OG
So I assumed I'd be able to include a module in a module after it has
been included, if you get my drift. It surprises me that this dog
doesn't bark.
module M2; include M1; end
module M1; DOG = :woof; end
module M2; DOG; end
# => :woof
I can add to a module after it has been included. Neat.
module M1; DOG = :woof; end
module M2; include M1; end
module M3; include M2; end
module M3; DOG; end
# => :woof
Including a module seems to give me any modules that it includes. Swish.
module M2; end
module M3; include M2; end
module M1; DOG = :woof; end
module M2; include M1; end
module M3; DOG; end
# => NameError: uninitialized constant M3:
So I assumed I'd be able to include a module in a module after it has
been included, if you get my drift. It surprises me that this dog
doesn't bark.