On Mon, Jan 21, 2013 at 8:15 AM, botp <[email protected]> wrote:
>
>
> On Mon, Jan 21, 2013 at 3:00 PM, Robert Klemme <[email protected]>
> wrote:
>>
>> You do not need .to_s inside string interpolation.  But what is the
>> point in suggesting that over this solution?
>>
>> s = "[#{9}]"
>
>
> sorry for the confusion, robert.  i just wanted to show how to combine auto
> or implied concat  w another expression (the to_s was just an example given
> by op.. could be any method that returns string)..

But the point of string interpolation is that the expression does
_not_ need to return a String because #to_s is applied automatically.

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- 
[email protected] | 
https://groups.google.com/d/forum/ruby-talk-google?hl=en


Reply via email to