I am trying to create hash from xml file
Hash.from_xml <<-EOX
<user>
<id>1</id>
<user-name>ryan</user-name>
</user>
EOX
when i use the above code it works fine and gives
{ :user => { :id => 1, :user_name => "ryan" } }
my problem is I have the xml part as a string
@xml ="<user><id>1</id><user-name>ryan</user-name></user>"
And trying to do following but its not working
Hash.from_xml <<-EOX
@xml
EOX
You don’t need the mutli-line string EOX stuff: