Module: Drymm::Shapes::JSONMethods
Overview
JSON serialization methods mixin.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#to_json(pretty: nil) ⇒ String
Dumps the instance to a JSON string.
Instance Method Details
#to_json(pretty: nil) ⇒ String
Dumps the instance to a JSON string.
14 15 16 17 18 19 20 |
# File 'lib/drymm/shapes/json_methods.rb', line 14 def to_json(pretty: nil) if pretty JSON.pretty_generate(to_hash, pretty) else JSON.fast_generate(to_hash) end end |