Class: Lutaml::Jsonschema::Spa::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/jsonschema/spa/generator.rb

Instance Method Summary collapse

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
13
# 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

#generateObject



15
16
17
18
19
# File 'lib/lutaml/jsonschema/spa/generator.rb', line 15

def generate
  document = SpaBuilder.new(@schema_set, metadata: @metadata).build
  json_data = document.to_json
  @strategy.write(json_data)
end