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
Instance Attribute Summary collapse
-
#media_types ⇒ Array<String>
(also: #mime_types)
readonly
abstract
private
Return supported media types.
Class Method Summary collapse
- .media_types ⇒ Object (also: mime_types) private
Instance Method Summary collapse
-
#initialize(media_types: []) ⇒ Parser
constructor
private
A new instance of Parser.
-
#parse(body, env = {}) ⇒ Hash
abstract
private
Parse raw HTTP request body.
Constructor Details
#initialize(media_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.
34 35 36 |
# File 'lib/hanami/middleware/body_parser/parser.rb', line 34 def initialize(media_types: []) @media_types = self.class.media_types + media_types end |
Instance Attribute Details
#media_types ⇒ Array<String> (readonly) Also known as: mime_types
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 media types
30 31 32 |
# File 'lib/hanami/middleware/body_parser/parser.rb', line 30 def media_types @media_types end |
Class Method Details
.media_types ⇒ Object Also known as: mime_types
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 |
# File 'lib/hanami/middleware/body_parser/parser.rb', line 11 def media_types = [] |
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
62 63 64 |
# File 'lib/hanami/middleware/body_parser/parser.rb', line 62 def parse(body, env = {}) # rubocop:disable Lint/UnusedMethodArgument raise NoMethodError end |