From: Rick DeNatale Date: 2009-02-20T02:18:33+09:00 Subject: Re: simple question re: ruby warning message --0016e644c5e2acc5ef046348b844 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Feb 19, 2009 at 4:19 AM, vimal wrote: > > Your representation (db_type= 'n' ? db = @nodes_h : db = @links_h) > > assigns db_type the result of the following: > > checks a condition 'n' > if true > db = @nodes_h > else > db = @links_h > end > Which, since any ruby object except nil and false is truthy is effectively the same thing as db_type = db = @nodes.h which makes db_type, and db reference the same object, which is the return valud of @nodes.h -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale --0016e644c5e2acc5ef046348b844--