[Nitro] Ruby library for serialization

George Moschovitis george.moschovitis at gmail.com
Wed Feb 14 09:35:53 EST 2007


Dear devs,

is there a Ruby library that can convert a Ruby object to XML, Atom, Json
etc?

I tried facets/more/json and facets/more/xoxo and they just use the .to_s
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?

regards,
George.


-- 
http://blog.gmosx.com
http://cull.gr
http://www.joy.gr
http://nitroproject.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070214/7ba02ece/attachment.html 


More information about the Nitro-general mailing list