Module: Mu::JSON

Extended by:
JSON
Included in:
JSON
Defined in:
lib/mu/json.rb,
lib/mu/json/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Method Summary collapse

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