Class: TraceViz::Exporters::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/trace_viz/exporters/registry.rb

Constant Summary collapse

EXPORTS =
{
  txt: TextExporter,
  mermaid: MermaidExporter,
}

Class Method Summary collapse

Class Method Details

.build(format, *options) ⇒ Object

Raises:

  • (ArgumentError)


15
16
17
18
19
# File 'lib/trace_viz/exporters/registry.rb', line 15

def build(format, *options)
  raise ArgumentError unless supported_formats.include?(format)

  EXPORTS[format].new(*options)
end

.supported_formatsObject



21
22
23
# File 'lib/trace_viz/exporters/registry.rb', line 21

def supported_formats
  EXPORTS.keys
end