S
Sy Ali
I want to simplify this hash creation:
g = { 1 => "test", 2 => "test", }
I have a particularly complicated hash that I'm generating. It can
have very large values.
Right now, I duplicate values with something like this:
c = { 1 => "one", }
d = { 2 => c[1], }
c.merge!(d)
however, I don't like the way my code looks.. I want to be able to
specify the duplication within the hash generation.
Is this possible?
g = { 1 => "test", 2 => "test", }
I have a particularly complicated hash that I'm generating. It can
have very large values.
Right now, I duplicate values with something like this:
c = { 1 => "one", }
d = { 2 => c[1], }
c.merge!(d)
however, I don't like the way my code looks.. I want to be able to
specify the duplication within the hash generation.
Is this possible?