N
nico Itkin
hi !
I'm new to ruby, i'd like to know if it is possible to make the
following kind of assignation in a hash, like i used to do in php :
a={}
a[:b][:c]="value"
the goal for me is to create a hash by iterating on keys, like
hash={}
[a,b,c].each do |k1|
[d,e,f].each do |k2|
hash[k1][k2] = afunction(k1,k2)
end
end
this last code lead to a nil.[] error
Could you help me ? .
I'm new to ruby, i'd like to know if it is possible to make the
following kind of assignation in a hash, like i used to do in php :
a={}
a[:b][:c]="value"
the goal for me is to create a hash by iterating on keys, like
hash={}
[a,b,c].each do |k1|
[d,e,f].each do |k2|
hash[k1][k2] = afunction(k1,k2)
end
end
this last code lead to a nil.[] error
Could you help me ? .