From: Jim Freeze Date: 2002-03-23T15:11:23+09:00 Subject: How can method in module access class const? Hi: How does one go about accessing a class constant from a method that is defined inside a module. The first example is what I would like to do, but it fails. The second example works if I place the method in the class directly. Thanks 1 module M 2 def initialize 3 puts CC 4 end 5 end 6 class C 7 CC = "CC" 8 include M 9 end 10 c=C.new # => unitialized constant CC at M (NameError) 1 class C 2 def initialize 3 puts CC 4 end 5 CC = "CC" 6 end 7 c=C.new # => CC -- Jim Freeze atto: 1e-18 = one quintillionth parsec: 3.258 light-years: 3.258 * 186000 * 364 * 24 * 3600 * 5280 * 12 attoparsec: atto * parsec =~ 1.20 inch My height: 62 inches / 1.2 = 51.7 attoparsecs ~