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 12 |
# File 'lib/request_handler/json_parser.rb', line 7 def initialize(document:, schema:, schema_options: {}) raise MissingArgumentError.new(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.
18 19 20 |
# File 'lib/request_handler/json_parser.rb', line 18 def document @document end |
Instance Method Details
#run ⇒ Object
14 15 16 |
# File 'lib/request_handler/json_parser.rb', line 14 def run validate_schema(document) end |