Class: Asciidoctor::Diagram::StructurizrBlockMacroProcessor

Inherits:
Extensions::BlockMacroProcessor
  • Object
show all
Defined in:
lib/asciidoctor-diagram/structurizr/extension.rb

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, config = nil) ⇒ StructurizrBlockMacroProcessor

Returns a new instance of StructurizrBlockMacroProcessor.



37
38
39
40
41
# File 'lib/asciidoctor-diagram/structurizr/extension.rb', line 37

def initialize(name = nil, config = nil)
  super
  @structurizr = StructurizrConvertBlockMacroProcessor.new(name)
  @renderers = Renderers.new(name)
end

Instance Method Details

#process(parent, target, attributes) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/asciidoctor-diagram/structurizr/extension.rb', line 43

def process parent, target, attributes
  structurizr_attrs = attributes.dup
  structurizr_attrs['format'] = 'txt'

  renderer_block = @structurizr.process(parent, target, structurizr_attrs)
  @renderers.get_renderer(BasicSource.new(self, parent, attributes)).process(parent, renderer_block, attributes)
end