Hi all, I'm trying to write a plugin which will allow me to specify: acts_as_item :option=>:value
i need to be able to access the :options=>:value hash from instances of the model also. I've tried with class_eval in the plugin, but can't get it working. I'm calling acts_as_item(options), and that method can see the options passed from a model. Then inside the class_eval, I'm adding a method (def self.configuration) which returns the options hash. I thought from an instance, I'd be able to do instance.class.configuration which would then return said options hash.
Any ideas? thanks for reading.
module Item #called by active record for us def self.included(base) base.extend ClassMethods end
module ClassMethods def acts_as_item(options = {}) configuration = {:option=>:value} class_eval { include InstanceMethods
def self\.configuration
I think you want this to be def configuration
Since this is in a module extended by the class.