Forum: Ruby Hash of arrays - initialization (was Re: Beyond YAML? (scali

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
A87f7a014c624587fab0d3d78c5b9c18?d=identicon&s=25 Bil Kleb (Guest)
on 2007-05-03 22:41
(Received via mailing list)
Brian Candler wrote:
> samples[tag] ||= []
> samples[tag] << sample
> And you can probably combine:
> (samples[tag] ||= []) << sample

Thanks; I figured the magic || operator was somehow
involved, but I still don't have that thing memorized...
yet more aggressive incompetence. :)

Thanks again,
This topic is locked and can not be replied to.