Class: Hanami::Middleware::BodyParser::Parser Private
- Inherits:
-
Object
- Object
- Hanami::Middleware::BodyParser::Parser
- Defined in:
- lib/hanami/middleware/body_parser/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.
Body parser abstract class
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_MIME_TYPES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[].freeze
Instance Attribute Summary collapse
-
#mime_types ⇒ Array<String>
readonly
abstract
private
Return supported mime types.
Instance Method Summary collapse
-
#initialize(mime_types: DEFAULT_MIME_TYPES) ⇒ Parser
constructor
private
A new instance of Parser.
-
#parse(body, env = {}) ⇒ Hash
abstract
private
Parse raw HTTP request body.
Constructor Details
#initialize(mime_types: DEFAULT_MIME_TYPES) ⇒ Parser
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.
Returns a new instance of Parser.
30 31 32 |
# File 'lib/hanami/middleware/body_parser/parser.rb', line 30 def initialize(mime_types: DEFAULT_MIME_TYPES) @mime_types = self.class.mime_types + mime_types end |
Instance Attribute Details
#mime_types ⇒ Array<String> (readonly)
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.
Return supported mime types
27 28 29 |
# File 'lib/hanami/middleware/body_parser/parser.rb', line 27 def mime_types @mime_types end |
Instance Method Details
#parse(body, env = {}) ⇒ 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 raw HTTP request body
58 59 60 |
# File 'lib/hanami/middleware/body_parser/parser.rb', line 58 def parse(body, env = {}) # rubocop:disable Lint/UnusedMethodArgument raise NoMethodError end |