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.
There are no reported vulnerabilities
30 Day SummaryJan 11 2026 — Feb 10 2026
|
12 Month SummaryFeb 10 2025 — Feb 10 2026
|