Is it possible somehow in Ruby to write in hash something like this:
"xmlns:soap"
So it will something like
:xmlns:soap
:"xmlns:soap"
will create a Symbol
out of your String
, regardless of the containing characters. This is the same as writing:
"xmlns:soap".to_sym
No
anything between the double quotes "
is a string/ So it will not allowed.
However you can do something like following
{value: :abc} # this will produce {:value=>:abc}
Note:- above code will work only for Ruby 1.9.3 for older versions write simply
{:value=>:abc}
:'your string'
syntax that is syntactic sugar to 'your string'.to_sym
and he will get what he want.