I have some modules in an array. All the modules define a method called "process", and I'd like to call each of these process methods in sequence. The code I have looks something like this(assume the modules are all defined inside the Mod class):
modules.each do |mod|
extend Mod.const_get(mod)
process(data)
end
This works fine for the first time, but the method doesn't get overwritten after the first pass of the loop. I've tried adding undef process
as the last line inside the each
block but that didn't work.
Is there any way I can do this?