D
Dale
I'd like to make a class constant using a module -- I cannot use <
because I am extending unit_test. -- Here's the idea:
module One
@@constant="constant"
end
module Two
def work
puts(@@constant)
end
end
class Constant_work
include One
include Two
end
Constant_work.new.work
IRB gives me:
NameError: uninitialized class variable @@constant in Two
How can I get what I want to happen?
Dale
because I am extending unit_test. -- Here's the idea:
module One
@@constant="constant"
end
module Two
def work
puts(@@constant)
end
end
class Constant_work
include One
include Two
end
Constant_work.new.work
IRB gives me:
NameError: uninitialized class variable @@constant in Two
How can I get what I want to happen?
Dale