"double assignation" in a hash?

is it possible to make a quick "double assignation " in a hash like in
php, for example :

a={}
a[:b][:c]=“value”

I don’t think so… why would you want to though? It’s not that much
more code to say

value = whatever_intecate_algorithm_or_calculation_you_need
a[:b] = value
a[:c] = value

or

a{ a=> value, b => value}

On Jun 4, 7:10 pm, nico Itkin [email protected]

nico Itkin wrote:

is it possible to make a quick "double assignation " in a hash like in
php, for example :

a={}
a[:b][:c]=“value”

it’s actually

a = {}
=> {}

a[:a] = a[:b] = 1
=> 1

a
=> {:a=>1, :b=>1}

script/console is your friend :slight_smile:

Peace,
Phillip