Idiomatic way to assign if not nil?

I've not yet seen the right answer on the original question:
"idiomatic way to assign if not nil?".

Since false isn't nil, a||=b can't a correct answer, AFAIK.

_A_ good answer could be:

a=b if a.nil?

gegroet,
Erik V. - http://www.erikveen.dds.nl/

False isn't nil, but nil is false.

ยทยทยท

On Sunday 02 September 2007 09:21:25 am Erik Veenstra wrote:

I've not yet seen the right answer on the original question:
"idiomatic way to assign if not nil?".

Since false isn't nil, a||=b can't a correct answer, AFAIK.

_A_ good answer could be:

a=b if a.nil?

gegroet,
Erik V. - http://www.erikveen.dds.nl/

--
Konrad Meyer <konrad@tylerc.org> http://konrad.sobertillnoon.com/