Created
April 26, 2010 09:17
-
-
Save neerajsingh0101/379132 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# note that last item is User class | |
a = [10, [20, 30, ["helo", "world"]], [1.2, 1.3], User] | |
puts a.to_xml | |
<?xml version="1.0" encoding="UTF-8"?> | |
<records type="array"> | |
<record type="integer">10</record> | |
<records type="array"> | |
<record type="integer">20</record> | |
<record type="integer">30</record> | |
<strings type="array"> | |
<record>helo</record> | |
<record>world</record> | |
</strings> | |
</records> | |
<floats type="array"> | |
<record type="float">1.2</record> | |
<record type="float">1.3</record> | |
</floats> | |
<record>User</record> | |
</records> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment