A
Aryk Grosz
Whenever Im coding I usually come across having to create a new hash
from the key/value pairs of another hash.
For example,
hash = {:a => 1, :b => 2, :c => 3}
I want to do something like this
hash.from_keysa,:b) => {:a=> 1, :b=> 2}
Is there something like this already? Perhaps in the facets library? I
looked and couldn't find anything.
If anybody thinks that I shouldnt even be getting into this situation in
the first place, please let me know that as well.
from the key/value pairs of another hash.
For example,
hash = {:a => 1, :b => 2, :c => 3}
I want to do something like this
hash.from_keysa,:b) => {:a=> 1, :b=> 2}
Is there something like this already? Perhaps in the facets library? I
looked and couldn't find anything.
If anybody thinks that I shouldnt even be getting into this situation in
the first place, please let me know that as well.