From: yvon.thoravalNO-SPAM@... (Yvon Thoraval) Date: 2004-03-20T18:19:33+09:00 Subject: [newbie] converting javascript to ruby (nested methods) 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. The script controls a "Calculator" which gui is written in xpml, an xml wrapper of java-swing components see : http://www.ultrid.com/index.php?module=Static_Docs&func=view&newlang=eng then i wonder how to convert this, for example : function doIt() { if ( type.equals("operand") ) { doOperand(); } else { doValue(); } } into a ruby script. each calculator's button as two fields associated with it a type (might be operand (ie +, =, -, /, *...) or value (0..9) and a value . 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 ? -- yt