Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created August 25, 2008 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vangberg/7065 to your computer and use it in GitHub Desktop.
Save vangberg/7065 to your computer and use it in GitHub Desktop.
$ irb
>> require 'harry_from_xml'
>> xml = '<menu>
<drink>
<name>Death in the Afternoon</name>
</drink>
<drink>
<name>Mojito</name>
</drink>
</menu>'
>> HarryFromXML.to_hash xml
=> {:menu=>{:drink=>[{:name=>"Death in the afternoon"}, {:name=>"Mojito"}]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment