Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

offers json/xml/yaml serialization and filtering for hashes

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 Mavenfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 ixtlan-babel.gemspec
README.md

babel

  • Build Status
  • Dependency Status
  • Code Climate

rails comes with to_json and to_xml on models and you can give them an option map to control how the whole object tree gets serialized.

the first problem I had was that I needed serveral options map at different controllers/actions so I needed a place to store them. the model itself felt to be the wrong place.

the next problem was that I could include the result of a given method with :methods => ['age'] but only on the root level of the object tree. but if I wanted to age method to be part of the serialization somewhere deep inside the object tree, it is not possible.

please have a look at spec/filter_spec.rb how to use it :)

TODO usage

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

meta-fu

enjoy :)

Something went wrong with that request. Please try again.