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
364 365 366 |
# File 'lib/class2.rb', line 364 def as_json(*) Util.as_json(self, :underscore) end |
#to_json(*argz) ⇒ Object
368 369 370 |
# File 'lib/class2.rb', line 368 def to_json(*argz) as_json.to_json(*argz) end |