From: Josh Cheek Date: 2010-10-19T15:52:54+09:00 Subject: Constant Lookup Confusion --001636c5b38f0971490492f2bc2b Content-Type: text/plain; charset=ISO-8859-1 Trying to dynamically set a constant, but I seem to either be defining it in the wrong place, or looking for it in the wrong place. module ClassMaker def self.make_class( classname , default ) theclass = Class.new do extend ClassMethods const_set :DEFAULT , default end Object.const_set classname , theclass end module ClassMethods def reset @value = DEFAULT end end end ClassMaker.make_class 'MyClass' , :my_default begin MyClass.reset rescue => e e # => # end --001636c5b38f0971490492f2bc2b--