-
Notifications
You must be signed in to change notification settings - Fork 2
Json builder which has the same interface with Builder::XmlMarkup
nov/jsonbuilder
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
= jsonbuilder by nov https://github.com/nov <[email protected]> and birkirb https://github.com/birkirb == Description == Installation git clone https://github.com/nov/jsonbuilder.git cd jsonbuilder rake install === Archive Installation rake install === Gem Installation gem install jsonbuilder --source http://gems.rubyforge.org OR for the lastest development version gem install nov-jsonbuilder --source http://gems.github.com == Features/Problems The Hash builder will return a hash structured in a similar way as the corresponding xml built by XmlMarkup. The Json builder will return the same kind of hash as a JSON string USAGE: def serialize(builder, options = {}) builder.user( :id => id, :url => url ) builder.array_mode do builder.images do package.images.each do |image| builder << image.builder(builder.class.new, :only_url => true) end end end builder.target! end def to_xml(options = {}) self.serialize(Builder::XMmlMarkup.new, options) end def to_hash(options = {}) self.serialize(Builder::HashStructure.new, options) end def to_json(options = {}) self.serialize(Builder::JsonFormat.new, options) end == Synopsis == Copyright Author:: nov <[email protected]> and birkirb Copyright:: Copyright (c) 2009 nov License:: MIT License
About
Json builder which has the same interface with Builder::XmlMarkup
Resources
Stars
Watchers
Forks
Packages 0
No packages published