Class: JsonMatchers::Parser
- Inherits:
-
Object
- Object
- JsonMatchers::Parser
- Defined in:
- lib/json_matchers/parser.rb
Instance Method Summary collapse
-
#initialize(schema_path) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(schema_path) ⇒ Parser
Returns a new instance of Parser.
3 4 5 |
# File 'lib/json_matchers/parser.rb', line 3 def initialize(schema_path) @schema_path = schema_path end |
Instance Method Details
#parse ⇒ Object
7 8 9 10 11 |
# File 'lib/json_matchers/parser.rb', line 7 def parse JsonSchema.parse!(schema_data) rescue JSON::ParserError, JsonSchema::SchemaError => error raise InvalidSchemaError.new(error) end |