From: Mark Hubbart Date: 2004-03-20T18:33:49+09:00 Subject: Re: [newbie] converting javascript to ruby (nested methods) On Mar 20, 2004, at 1:19 AM, Yvon Thoraval wrote: > i have a script written in javascript and want to translate it into > ruby > (using JRuby) but i face with the error about nested method which used > ofently in javascript. nested method? That doesn't sound familiar. Could you post the actual error printout that you get? That should help tack it down. > obviously i've tried something like : > > def doIt(type, value) > if type == "operand" > doOperand(type, value) > else > doValue(type, value) > end > end > > what is the ruby way for such nested methods ? Honestly, this code looks fine to me, assuming you definded "doOperand()" and "doValue()" elsewhere in the script. Could you post a little more code? :) --Mark