I am looking for a way to serialize/deseialize an object from its xml/json representation.
I am not concerned about xml namespaces.
Is there anything in Ruby which 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
Coming from a .Net background, I am looking for something which lets me consume/dispatch objects from restful web services.
How do you consume webservices in rails? (xml and json). Using xpath/active resource seems a bit too verbose (even for a .Net person)
Using ruby 1.9.x, Rails 3.x
Thanks