How would I reverse the elements in the hash, keeping the same values and keys, but reversing their order in the hash.
Like so:
{ \"4\" => \"happiness
Alternatively, you can use reduce and merge to add the item to the front of a new hash:
reduce
merge
hash = { "4" => "happiness", "10" => "cool", "lala" => "54", "1" => "spider" } hash.reduce({}){ |memo, object| Hash[*object].merge(memo) }
but, that's crazy :D