From: Kaldrenon Date: 2007-08-22T02:59:58+09:00 Subject: Re: How to "cast" in Ruby On Aug 21, 11:15 am, Phrogz wrote: > > How about: arr << "#{el.elements["id"].get_text}".to_i ? > > If you ever are tempted to write: > "#{foo}" > you should realize that it's functionally equivalent to > foo.to_s It is. But "#{foo}" was more in keeping with the OP's original code, and I personally prefer to keep the length of call chains (as in foo.bar.xxx.yyy.zzz) to a minimum. It ultimately amounts to preference, IMO, as both are readily legible and easy to understand. It's also exactly the same number of characters.