atomicobject / to_apiView on GitHub
Instead of to_xml and as_json, simply implement to_api. Return an unformatted hash. Let the model understand the data. Let the controller understand the format. In Rails, the controller can simply call render :xml => model.to_api or render :json => model.to_api.
16Jan 20, 2017Updated 9 years ago

Alternatives and similar repositories for to_api

Users that are interested in to_api are comparing it to the libraries listed below. We may earn a commission when you buy through links labeled 'Ad' on this page.

Sorting:

Are these results useful?