E
eastcoastcoder
I'd like to def const_missing to require the appropriate file, without
needing to put require 'filename' in the top of my code.
Something like
const_missing MyMod::MyClass --> require 'my_mod/my_class' ; return
MyMod::MyClass
I got this idea from ActiveRecord.
Any comments / advice on using this for general programmign? Any
reason not to? I think it would clean up a lot of the require lines,
and make refactoring (and moving things around) easier, without really
detracting.
needing to put require 'filename' in the top of my code.
Something like
const_missing MyMod::MyClass --> require 'my_mod/my_class' ; return
MyMod::MyClass
I got this idea from ActiveRecord.
Any comments / advice on using this for general programmign? Any
reason not to? I think it would clean up a lot of the require lines,
and make refactoring (and moving things around) easier, without really
detracting.