L
Lloyd Zusman
Suppose I have a file named 'modtest' which contains the following two
lines:
X = 1
Y = 2
Then, I execute this ruby code:
mod = Module.new {
load('modtest')
}
p mod.constants
When this code runs, I see this: []
In other words, it's an empty array, which means that I'm not seeing the
constants X and Y.
Why is this? Is there any way to load the file 'modtest' so that the
resulting anonymous module indeed contains these constants?
Thanks in advance.
lines:
X = 1
Y = 2
Then, I execute this ruby code:
mod = Module.new {
load('modtest')
}
p mod.constants
When this code runs, I see this: []
In other words, it's an empty array, which means that I'm not seeing the
constants X and Y.
Why is this? Is there any way to load the file 'modtest' so that the
resulting anonymous module indeed contains these constants?
Thanks in advance.