Class: Jsonschema::Generator::Draft07
- Inherits:
-
Object
- Object
- Jsonschema::Generator::Draft07
- Defined in:
- lib/jsonschema/generator/draft07.rb
Overview
Draft 07
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(raw_json, options = {}) ⇒ Draft07
constructor
A new instance of Draft07.
Constructor Details
#initialize(raw_json, options = {}) ⇒ Draft07
Returns a new instance of Draft07.
9 10 11 12 13 |
# File 'lib/jsonschema/generator/draft07.rb', line 9 def initialize(raw_json, = {}) @raw_json = raw_json @options = @parsed_json = parse(raw_json) end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 |
# File 'lib/jsonschema/generator/draft07.rb', line 15 def call raise Error, 'Invalid Input. JSON expected' unless parsed_json { 'title' => ROOT_TITLE }.merge(generate(parsed_json)) end |