P
Pokkai Dokkai
user_name@host:~$irb
irb(main):001:0> h={'k1'=>'v1','k2'=>'v2','k3'=>'v3'}
=> {"k1"=>"v1", "k2"=>"v2", "k3"=>"v3"} ------->i want as a string
object
irb(main):002:0> k
irb(main):004:0> puts h
k1v1k2v2k3v3 ------->i don't want
=> nil
irb(main):005:0> h
any idea to make a hash object to string object as look like a hash (
"{"k1"=>"v1", "k2"=>"v2", "k3"=>"v3"}".class --->String )
above i shown what i want
is there any library in ruby to get this?
irb(main):001:0> h={'k1'=>'v1','k2'=>'v2','k3'=>'v3'}
=> {"k1"=>"v1", "k2"=>"v2", "k3"=>"v3"} ------->i want as a string
object
irb(main):002:0> k
irb(main):004:0> puts h
k1v1k2v2k3v3 ------->i don't want
=> nil
irb(main):005:0> h
any idea to make a hash object to string object as look like a hash (
"{"k1"=>"v1", "k2"=>"v2", "k3"=>"v3"}".class --->String )
above i shown what i want
is there any library in ruby to get this?