Skip to navigation
How to use a varialbe as a hash key.?
07.12.13
Use eval: var = "id" var2 = "name" Hashobj = {:id =>1,:name=>'foo'} eval("Hashobj[:#{var}]") --> 1 eval("Hashobj[:#{var2}]") --> foo
Reply
Anonymous
How to use a varialbe as a hash key.?
Use eval: var = "id" var2 = "name" Hashobj = {:id =>1,:name=>'foo'} eval("Hashobj[:#{var}]") --> 1 eval("Hashobj[:#{var2}]") --> foo
07.12.13
Reply
Anonymous
Information Epoch 1737560655
Allow the user to tailor the environment.
Home
Notebook
Contact us