From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9vue?=) Date: 2010-06-03T00:15:05+09:00 Subject: Re: having a class method called only one time ? Tony Arcieri wrote: > You can "memoize" the result of such an operation in an instance variable by > doing > > @cached_result ||= big_expensive_operation > > This will use the value of @cached_result unless it's unset/nil, otherwise > it will invoke the expensive operation and store the result in an ivar fine thanks, that's cleaner than my code ! -- � Les faiblesses des hommes font la force des femmes. � (Voltaire)