Class: Lutaml::Xsd::Spa::OutputMode

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/xsd/spa/output_mode.rb

Overview

Handles different output modes for SPA documentation

Supports single-file (embedded) and multi-file (distributed) output modes with appropriate file organization.

Class Method Summary collapse

Class Method Details

.create(mode:, output_path: nil, output_dir: nil, verbose: false) ⇒ OutputMode

Create output mode handler

Parameters:

  • mode (String)

    Output mode (‘single’ or ‘multi’)

  • output_path (String, nil) (defaults to: nil)

    Output file path (single mode)

  • output_dir (String, nil) (defaults to: nil)

    Output directory (multi mode)

  • verbose (Boolean) (defaults to: false)

    Enable verbose output

Returns:



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/lutaml/xsd/spa/output_mode.rb', line 20

def self.create(mode:, output_path: nil, output_dir: nil,
verbose: false)
  case mode
  when "single"
    SingleFileMode.new(output_path, verbose)
  when "multi"
    MultiFileMode.new(output_dir, verbose)
  else
    raise ArgumentError, "Invalid mode: #{mode}"
  end
end