Class: Hanami::Routing::Parsing::JsonParser Private
- Defined in:
- lib/hanami/routing/parsing/json_parser.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #mime_types ⇒ Object private
-
#parse(body) ⇒ Hash
private
Parse a json string.
Methods inherited from Parser
Instance Method Details
#mime_types ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/hanami/routing/parsing/json_parser.rb', line 11 def mime_types ['application/json', 'application/vnd.api+json'] end |
#parse(body) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parse a json string
25 26 27 28 29 |
# File 'lib/hanami/routing/parsing/json_parser.rb', line 25 def parse(body) Hanami::Utils::Json.parse(body) rescue Hanami::Utils::Json::ParserError => e raise BodyParsingError.new(e.) end |