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 16 |
# File 'lib/request_handler/body_parser.rb', line 9 def initialize(request:, schema:, type: nil, schema_options: {}) raise MissingArgumentError.new("request.body": "is missing") if request.body.nil? @request = request @schema = schema = @type = type end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/request_handler/body_parser.rb', line 18 def run DocumentParser.new( type: type, document: request_body, schema: schema, schema_options: ).run end |