Module: Fusion::CLI::Parser
Instance Method Summary collapse
-
#parse(wire_pair) ⇒ Object
WirePair -> runtime value.
Instance Method Details
#parse(wire_pair) ⇒ Object
WirePair -> runtime value
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fusion/cli/parser.rb', line 13 def parse(wire_pair) value = convert(JSON.parse(wire_pair.data)) wire_pair.status == 1 ? Interpreter::ErrorVal.new(value) : value rescue JSON::ParserError Interpreter::ErrorVal.internal( kind: "syntax_error", location: "input", operation: "parsing input as JSON", input: wire_pair.data, message: "input is not valid JSON" ) end |