Module: Hanami::Utils::Json
- Defined in:
- lib/hanami/utils/json.rb
Overview
JSON wrapper
If you use MultiJson gem this wrapper will use it. Otherwise - JSON std lib.
Defined Under Namespace
Classes: MultiJsonAdapter
Constant Summary collapse
- ParserError =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
::JSON::ParserError
- @@engine =
This classvariable is part of a private API. You should avoid using this classvariable if possible, as it may be removed or be changed in the future.
::JSON
Class Method Summary collapse
-
.generate(object) ⇒ String
Generate a JSON document from the given object.
-
.parse(payload) ⇒ Object
Parses the given JSON paylod.
Class Method Details
.generate(object) ⇒ String
Generate a JSON document from the given object
76 77 78 |
# File 'lib/hanami/utils/json.rb', line 76 def self.generate(object) @@engine.generate(object) end |
.parse(payload) ⇒ Object
Parses the given JSON paylod
65 66 67 |
# File 'lib/hanami/utils/json.rb', line 65 def self.parse(payload) @@engine.parse(payload) end |