From: Joel VanderWerf Date: 2008-02-20T07:30:26+09:00 Subject: Re: ||= [] idiom MenTaLguY wrote: > Often it can make sense to factor the ||= portion into a > separate method: > > def category_for(tag) > @categories[tag] ||= [] > end > > # ... > > category_for(resource.tag) << resource That's something I've used frequently. It's kind of a poor man's dependency injection. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407