Class: Asciidoctor::Diagram::StructurizrBlockProcessor

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of StructurizrBlockProcessor.



15
16
17
18
19
# File 'lib/asciidoctor-diagram/structurizr/extension.rb', line 15

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

Instance Method Details

#process(parent, reader, attributes) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/asciidoctor-diagram/structurizr/extension.rb', line 21

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

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