Class: Lutaml::Xsd::Spa::Generator
- Inherits:
-
Object
- Object
- Lutaml::Xsd::Spa::Generator
- Defined in:
- lib/lutaml/xsd/spa/generator.rb
Overview
Main SPA documentation generator
Generates interactive HTML Single Page Application documentation from XSD schemas using Vue.js frontend.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
Instance Method Summary collapse
-
#generate ⇒ Array<String>
Generate SPA documentation.
-
#initialize(package, output_path, options = {}) ⇒ Generator
constructor
Initialize SPA generator.
Constructor Details
#initialize(package, output_path, options = {}) ⇒ Generator
Initialize SPA generator
33 34 35 36 37 38 39 |
# File 'lib/lutaml/xsd/spa/generator.rb', line 33 def initialize(package, output_path, = {}) @package = package @output_path = output_path @options = @config_loader = ConfigurationLoader.new @serializer = SchemaSerializer.new(package) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
24 25 26 |
# File 'lib/lutaml/xsd/spa/generator.rb', line 24 def @options end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
24 25 26 |
# File 'lib/lutaml/xsd/spa/generator.rb', line 24 def output_path @output_path end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
24 25 26 |
# File 'lib/lutaml/xsd/spa/generator.rb', line 24 def package @package end |
Instance Method Details
#generate ⇒ Array<String>
Generate SPA documentation
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/lutaml/xsd/spa/generator.rb', line 44 def generate log "Starting SPA generation..." # Create output strategy strategy = create_strategy mode = [:mode] || "inlined" strategy_name = "#{mode.split('_').map(&:capitalize).join(' ')} Strategy" log "✓ Using #{strategy_name}" # Serialize schema data serialized_data = @serializer.serialize log "✓ Serialized #{serialized_data[:schemas]&.size || 0} schema(s)" # Generate output using strategy output_files = strategy.generate(serialized_data, nil) log "✓ Generated #{output_files&.size || 0} file(s)" output_files end |