Library for creating XML from JSON
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
smoothie_xml.gemspec

README.md

SmoothieXML

How to work with XML API without heartache

Installation

Add this line to your application's Gemfile:

gem 'smoothie_xml', github: 'achempion/smoothie_xml'

Usage

SmoothieXML.cook do

  {
    catalog: [
      {catalog_item: {smoothie_params: {price: 100, 'xml:lang' => 'en'}, smoothie_value: 'MacBook Air'}},
      {catalog_item: 'MacBook Pro'}
    ]
  }

end

will convert to

<Catalog>
  <CatalogItem Price="100" xml:lang="en">
    MacBook Air
  </CatalogItem>

  <CatalogItem>
    MacBook Pro
  </CatalogItem>
</Catalog>