Module: Occi::Core::Helpers::RawJsonParser
- Defined in:
- lib/occi/core/helpers/raw_json_parser.rb
Overview
Introduces JSON parsing to various parser classes. This allowes parsers to convert JSON-formatted text into hashes.
Instance Method Summary collapse
-
#raw_hash(body) ⇒ Object
:nodoc:.
Instance Method Details
#raw_hash(body) ⇒ Object
:nodoc:
10 11 12 13 14 |
# File 'lib/occi/core/helpers/raw_json_parser.rb', line 10 def raw_hash(body) JSON.parse body, symbolize_names: true rescue StandardError => ex raise Occi::Core::Errors::ParsingError, "JSON parsing failed: #{ex.}" end |