S
S. Robert James
I would like to reference constants and classes defined in module
People in the class Schedule.
class Login is not part of any module (other than the root).
doing this:
class Schedule
include People
def a_method
# Worker.new won't work
People::Worker.new # works
end
end
doesn't work.
Is there a way to include the module People so that I don't need to
prefix People:: for only one particular class?
Also, why doesn't what I tried work? Doesn't include copy in the
constants, and aren't classes just constants?
People in the class Schedule.
class Login is not part of any module (other than the root).
doing this:
class Schedule
include People
def a_method
# Worker.new won't work
People::Worker.new # works
end
end
doesn't work.
Is there a way to include the module People so that I don't need to
prefix People:: for only one particular class?
Also, why doesn't what I tried work? Doesn't include copy in the
constants, and aren't classes just constants?