Class: RequestHandler::JsonParser
- Inherits:
-
SchemaParser
- Object
- SchemaParser
- RequestHandler::JsonParser
- Defined in:
- lib/request_handler/json_parser.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
-
#initialize(document:, schema:, schema_options: {}) ⇒ JsonParser
constructor
A new instance of JsonParser.
- #run ⇒ Object
Constructor Details
#initialize(document:, schema:, schema_options: {}) ⇒ JsonParser
Returns a new instance of JsonParser.
7 8 9 10 11 |
# File 'lib/request_handler/json_parser.rb', line 7 def initialize(document:, schema:, schema_options: {}) raise MissingArgumentError, "json": 'no content sent in document' if document.nil? super(schema: schema, schema_options: ) @document = document end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
17 18 19 |
# File 'lib/request_handler/json_parser.rb', line 17 def document @document end |
Instance Method Details
#run ⇒ Object
13 14 15 |
# File 'lib/request_handler/json_parser.rb', line 13 def run validate_schema(document) end |