A
acmeman1
I understand that the key of a hash can be any object. Therefore,
I would think that the key of a hash can be another hash. If I have
the following code sequence. (I using ruby 1.8.5 (2006-08-25) [i486-
linux])
require 'pp'
test ={}
test["new"=>"girl"]= 100
test["new"=>"girl"]= 200
pp test
I am expecting the output to be
{{"new"=>"girl"}=>200}
However the output I am getting is
{{"new"=>"girl"}=>100,
{"new"=>"girl"}=>200}
Could some explain how to use hash key which is of type hash
I would think that the key of a hash can be another hash. If I have
the following code sequence. (I using ruby 1.8.5 (2006-08-25) [i486-
linux])
require 'pp'
test ={}
test["new"=>"girl"]= 100
test["new"=>"girl"]= 200
pp test
I am expecting the output to be
{{"new"=>"girl"}=>200}
However the output I am getting is
{{"new"=>"girl"}=>100,
{"new"=>"girl"}=>200}
Could some explain how to use hash key which is of type hash