Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.mixmin.net!feeds.phibee-telecom.net!talisker.lacave.net!lacave.net!not-for-mail From: Fily Salas Newsgroups: comp.lang.ruby Subject: Understanding the return method Date: Sat, 16 Apr 2011 17:41:30 -0500 Organization: Service de news de lacave.net Lines: 28 Message-ID: <4aa6da7c8d4c99589c8a48a80c677218@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1302994242 15621 65.111.164.187 (16 Apr 2011 22:50:42 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Sat, 16 Apr 2011 22:50:42 +0000 (UTC) X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 381727 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <4aa6da7c8d4c99589c8a48a80c677218@ruby-forum.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:3036 Hi, As always, I'm asking simple questions sorry. Please help me to understand the "return" method because I dont see where or how to use it. Here I'm using the return method but the thing is that if remove it, it also works, so I was wondering why would you use it if by defaul all methods return a value? def multiply(val1, val2 ) result = val1 * val2 return result end value = multiply( 10, 20 ) puts value Can some one show me the main purpose of using the return method? Again I'm currently trying to understand the basics, so please be patient : ) Thanks -- Posted via http://www.ruby-forum.com/.