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
353 354 355 |
# File 'lib/class2.rb', line 353 def as_json(*) Util.as_json(self, :underscore) end |
#to_json(*argz) ⇒ Object
357 358 359 |
# File 'lib/class2.rb', line 357 def to_json(*argz) as_json.to_json(*argz) end |