Module: Class2::SnakeCase::JSON
- Defined in:
- lib/class2.rb
Overview
Create JSON documents that have snake_case
properties. This will add #as_json and #to_json methods.
Instance Method Summary collapse
Instance Method Details
#as_json ⇒ Object
326 327 328 |
# File 'lib/class2.rb', line 326 def as_json(*) Util.as_json(self, :underscore) end |
#to_json(*argz) ⇒ Object
330 331 332 |
# File 'lib/class2.rb', line 330 def to_json(*argz) as_json.to_json(*argz) end |