From: Paul Lutus Date: 2006-11-26T02:50:09+09:00 Subject: Re: coding practise sempsteen wrote: > correction: > this also does two method calls > puts hsh['id'] if hsh['id'] != nil > > this is the one which i wanted to write, only one method call: > result = hsh['id'] > puts result if result != nil Or: if(result = hsh[id]) puts result end -- Paul Lutus http://www.arachnoid.com