Class: RequestHandler::BodyParser
- Inherits:
-
Object
- Object
- RequestHandler::BodyParser
- Defined in:
- lib/request_handler/body_parser.rb
Instance Method Summary collapse
-
#initialize(request:, schema:, type: nil, schema_options: {}) ⇒ BodyParser
constructor
A new instance of BodyParser.
- #run ⇒ Object
Constructor Details
#initialize(request:, schema:, type: nil, schema_options: {}) ⇒ BodyParser
Returns a new instance of BodyParser.
9 10 11 12 13 14 15 |
# File 'lib/request_handler/body_parser.rb', line 9 def initialize(request:, schema:, type: nil, schema_options: {}) raise MissingArgumentError, "request.body": 'is missing' if request.body.nil? @request = request @schema = schema @schema_options = @type = type end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/request_handler/body_parser.rb', line 17 def run DocumentParser.new( type: type, document: request_body, schema: schema, schema_options: ).run end |