Module: Grape::Json
- Defined in:
- lib/grape/json.rb,
lib/grape/json.rb
Overview
Legacy multi_json (< 1.21) predates generate/parse and only exposes dump/load. Map Grape’s surface onto them so the call sites stay engine-agnostic (these names are not deprecated on < 1.21).
Constant Summary collapse
- ParseError =
Mutually exclusive with the MultiJSON branch above; only one runs.
Json::ParserError
Class Method Summary collapse
- .dump(object) ⇒ Object
-
.parse(source) ⇒ Object
parse is not deprecated; it’s re-exposed (not renamed) because this facade is its own module and no longer inherits MultiJSON’s methods.
Class Method Details
.dump(object) ⇒ Object
13 14 15 |
# File 'lib/grape/json.rb', line 13 def dump(object) ::MultiJSON.generate(object) end |
.parse(source) ⇒ Object
parse is not deprecated; it’s re-exposed (not renamed) because this facade is its own module and no longer inherits MultiJSON’s methods.
19 20 21 |
# File 'lib/grape/json.rb', line 19 def parse(source) ::MultiJSON.parse(source) end |