[Nitro] Ruby library for serialization
george.moschovitis at gmail.com
Wed Feb 14 11:35:41 EST 2007
as i demonstrated to_json does not work as expected...
On 2/14/07, transfire at gmail.com <transfire at gmail.com> wrote:
> On Feb 14, 9:35 am, "George Moschovitis"
> <george.moschovi... at gmail.com> wrote:
> > Dear devs,
> > is there a Ruby library that can convert a Ruby object to XML, Atom,
> > etc?
> > I tried facets/more/json and facets/more/xoxo and they just use the
> > method of the object, ie
> > class Article
> > attr_accessor :title, :content, :author
> > def to_s; @title; end
> > end
> > a = Article.new
> > a.title = 'hello'
> > a.content = '...'
> > a.author = 'george'
> > a.to_json # => 'hello'
> > which is not what I expected.
> > any suggestions?
> The JSON lib has #to_json, the XOXO lib has to_xoxo. There is a a way
> to do XML serialization that's built-into ruby, but it's a little more
> involved and I don't recall off hand how to do so. (Was it via the
> soap lib?) Need to look that up --if you do please let us know.
> Nitro-general mailing list
> Nitro-general at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Nitro-general