Module: Mu::JSON
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Method Summary collapse
-
#parse(value) ⇒ Object
‘value` is a string.
Instance Method Details
#parse(value) ⇒ Object
‘value` is a string
9 10 11 12 13 14 |
# File 'lib/mu/json.rb', line 9 def parse(value) data = ::JSON.parse(value) Result.success(data) rescue ::JSON::ParserError, TypeError Result.error.code!(:invalid_json) end |