Symbol To String
foo = {
:a => 1,
:b => 2
}
foo.with_indifferent_access
=>
{
"a" => 1,
"b" => 2
}
String To Symbol
foo = {
"a" => 1,
"b" => 2
}
foo.symbolize_keys
=>
{
:a => 1,
:b => 2
}
Symbol To String
foo = {
:a => 1,
:b => 2
}
foo.with_indifferent_access
=>
{
"a" => 1,
"b" => 2
}
String To Symbol
foo = {
"a" => 1,
"b" => 2
}
foo.symbolize_keys
=>
{
:a => 1,
:b => 2
}