Class: Lutaml::Jsonschema::Spa::Generator
- Inherits:
-
Object
- Object
- Lutaml::Jsonschema::Spa::Generator
- Defined in:
- lib/lutaml/jsonschema/spa/generator.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(schema_set, output_path, metadata: Metadata.new, strategy: nil) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(schema_set, output_path, metadata: Metadata.new, strategy: nil) ⇒ Generator
Returns a new instance of Generator.
7 8 9 10 11 12 |
# File 'lib/lutaml/jsonschema/spa/generator.rb', line 7 def initialize(schema_set, output_path, metadata: Metadata.new, strategy: nil) @schema_set = schema_set @output_path = output_path @metadata = @strategy = strategy || VueInlinedStrategy.new(@output_path) end |
Instance Method Details
#generate ⇒ Object
14 15 16 17 18 |
# File 'lib/lutaml/jsonschema/spa/generator.rb', line 14 def generate document = SpaBuilder.new(@schema_set, metadata: @metadata).build json_data = document.to_json @strategy.write(json_data) end |