From: Tito Ciuro Date: 2007-10-20T00:36:06+09:00 Subject: Re: Is it always the norm to skip 'return'? --Apple-Mail-4--247399201 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi Jeremy, On Oct 19, 2007, at 8:28 AM, Jeremy McAnally wrote: > Ruby always returns the last value used in the method; it's pretty > redundant to use return in most cases. In your example, I see no > reason to use return. I see that > Digest::SHA1.hexdigest(string_to_hash) was the last value used in the > method, so therefore I know that's what is coming back to the code > that called it. > > It's a Ruby idiom, but it's not as confusing as some. :) > > --Jeremy I think my confusion has to do with not knowing for sure whether a particular method returns something or not. Perhaps my example was not the best one. I've seen some ambiguous methods that makes you really wonder whether it returns something or not. I think that if a statement was preceded with a return, it would be a little easier to recognize. Not a biggie :-) Thank you, -- Tito --Apple-Mail-4--247399201--