From: Carlos Date: 2007-01-05T18:49:01+09:00 Subject: Re: puts returns nil? Arfon Smith wrote: > [...] A method returns the value of the last statement, not a list of all of them. In your method, the return value of puts (which is nil, btw) is discarded. > def say_moo number_of_moos > puts 'mooooooo...' * number_of_moos > 'yellow submarine' > end > > x = say_moo 3 Here you call say_moo. Say_moo puts 3 moo's in you screen, then returns 'yellow submarine'. This return value is assigned to x. > puts x.capitalize + ', dude...' Puts the value of x ('yellow submarine') capitalized, plus ', dude...'. > puts x + '.' Puts the value of x, plus a dot. HTH. Good luck. --