Ben J. wrote:
Is there anything out there that does this? Thanks for your help.
FWIW, JRuby is 1.8.6ish and has insertion-ordered hashes like 1.9.
- Charlie
Ben J. wrote:
Is there anything out there that does this? Thanks for your help.
FWIW, JRuby is 1.8.6ish and has insertion-ordered hashes like 1.9.
On Oct 2, 2008, at 11:05 PM, Ben J. wrote:
Thanks Erik, I agree 100%. I ONLY applied this when testing,
but that invalidates the tests
where
performance really isn’t an issue. I just needed hashes to iterate
in a
consistent order. What was unique about my situation is that the hash
order didn’t matter to the functional purpose of the method. It
mattered
only when I needed to do assertions in my tests.
Honestly, if order if meaningful you should use an array. I think
any of
the above gems are not the best choice when it comes to performance.
arrayfields gives you both - an array with hash access
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs