class A
X = 9
Y = B::X
end
class B
X = 8
Y = A::X
end
I have two classes, each of which defines some constants, but requires constants from the other, as shown above, but this gives me an error:
circle.rb: 7: in <class:A>': uninitialized constant A::B (NameError)
from circular.rb:5:in'
Is there any way to resolve the error?
Thank.
source
share