2009/11/5 dhf0820@[...].com <dhf0820@[...].com> :> I am trying to write a program that will load a series of DSLs (ruby> files) into it and then call the same class method in each one until> one returns something other than nil. Â The current DSL is just a ruby> class that subclasses the same "descriptor" superclass. The number of> DSLs loaded is not know until runtime as it is all the files in a> directory.> > > Any pointers on this?
Not sure what you're after but it seems a simple iteration will do:
res = nil
class = classes.find {|cl| res = cl.your_method}
If you do not need the class you can remove the second assignment.
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/