Reputation: 1109
Is it possible somehow in Ruby to write in hash something like this:
"xmlns:soap"
So it will something like
:xmlns:soap
Upvotes: 0
Views: 144
Reputation: 4157
:"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
Upvotes: 5
Reputation: 47482
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}
Upvotes: -1