B
Bob Sidebotham
This seems very odd to me:
module A
module B
end
end
module X
include A
module Y
B # => uninitialized constant X::Y::B (NameError
end
end
If I move the "include A" either up one line (before "module X"), or
down one line (after "module Y"), then it works as expected. Since
include is supposed to import all the constants from one module to the
other, then surely this should make the constants of A available to
anything defined within X?
My intent, in doing this, is to include A's semantics only where they
are relevant...
This may or may not be the way it's supposed to work--but for me, it
does violate POLS.
Puzzled,
Bob Sidebotham
module A
module B
end
end
module X
include A
module Y
B # => uninitialized constant X::Y::B (NameError
end
end
If I move the "include A" either up one line (before "module X"), or
down one line (after "module Y"), then it works as expected. Since
include is supposed to import all the constants from one module to the
other, then surely this should make the constants of A available to
anything defined within X?
My intent, in doing this, is to include A's semantics only where they
are relevant...
This may or may not be the way it's supposed to work--but for me, it
does violate POLS.
Puzzled,
Bob Sidebotham