Duane Johnson
2005-Jun-09 00:55 UTC
What''s the best way to get access to class_inheritable_*?
I''m working on Lucas Carlson''s Payment module and thought that some class_inheritable attributes would be handy for setting defaults for the various gateways. But the payment module won''t always be used in conjunction with Rails--it should be able to stand on its own for anyone to use in any project. What would you suggest is the best way to gain access to the class_inheritable_hash (and other) methods in a way that neither conflicts with nor requires Rails? And preferably DRY, if I can have my cake and eat it too :) I can think of three options (none of which is perfectly satisfactory): 1. Duplicate the ClassInheritableAttributes code and add it to the payment module (conflicts?) 2. Make ClassInheritableAttributes its own gem that can be depended on 3. Include ClassInheritableAttributes if and only if it exists, making any functionality that depends on it optional. oh, or, 4. Get ClassInheritableAttributes included in to the Ruby core :) Thanks for your feedback, Duane Johnson (canadaduane)