From: Gavin Kistner Date: 2005-07-06T04:44:03+09:00 Subject: Re: What is wrong in this code ... ??? --Apple-Mail-1-551515356 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jul 5, 2005, at 1:37 PM, Daniel Nugent wrote: > The extra assignment is unnecessary too. > > you can just do > > def show > return "Name: " + @name > end Or, because the last value in a method is the return value (in the absence of a call to the #return method) you can simply do: def show "Name: " + @name end or, even better, use string interpolation: def show "Name: #{@name}" end and finally, because instance variables are special, even: def show "Name: #@name" end will work. --Apple-Mail-1-551515356--