I am looking for a way to serialize / deseialize an object from its xml / json view.
I'm not interested in xml namespaces.
Is there anything in Ruby that allows me to do:
class Person
attr :name, true
attr :age, true
attr :sex, true
end
person_xml =
"<Person>
<name>Some Name</name>
<age>15</age>
<sex>Male</male>
</Person>"
// and then do
p = person_xml.deserialize(Person.class)
// or something of that sort
Based on the .Net background, I am looking for something that allows me to consume / send objects from quiet web services.
How do you use web services on rails? (xml and json). Using xpath / active resource seems too verbose (even for .Net person)
Using ruby 1.9.x, Rails 3.x
thank
source
share