From: jin chizhong Date: 2013-06-02T06:35:46+09:00 Subject: Is it a bug(about constant reference on dynamic class). When I use a dynamic class, It can not reference constants. See follow code and remark. And is there any way to work around it? #!/usr/bin/env ruby class T def hello puts self.class.constants.join " " # right, AAA puts AAA # right, 1 end end T::AAA = 1 t = T.new t.hello c = Class.new do def hello puts self.class.constants.join " " # right, AAA puts AAA # error: uninitialized constant AAA (NameError) end end c::AAA = 123 inst = c.new inst.hello -- Posted via http://www.ruby-forum.com/.