Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# note that last item is User class
a = [10, [20, 30, ["helo", "world"]], [1.2, 1.3], {:foo => :bar}, User]
puts a.to_xml
<?xml version="1.0" encoding="UTF-8"?>
<objects type="array">
<object type="integer">10</object>
<object type="array">
<object type="integer">20</object>
<object type="integer">30</object>
<object type="array">
<object type="array">
<object type="float">1.2</object>
<object type="float">1.3</object>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.