Automatic Pluar to Singluar derivation in Loops

Hallo,

Enyoing the Rails framework, I often write loop like this:

for j_method in @service.j_methods
   for parameter in j_method.parameters
	  @output = j_method.name+ " is in "+parameter.name
   end
end

So:

  • @service.j_methods => j_method

  • j_method.parameters => parameter

    forall @service.j_methods
    forall j_method.parameters
    @output = j_method.name+ " is in "+parameter.name
    end
    end

Question:

  • How could such a functionality be done?

Thank you
Olivier


Olivier Châtelain
Change- und Configurationmanagement (CCCM)
Tel: +41 (0)31 666 52 45
Fax: +41 (0)31 666 16 09
mailto:[email protected]

RTC Real-Time Center AG
Schwarzenburgstrasse 160
3097 Liebefeld