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