Class: Asciidoctor::Diagram::ReaderSource

Inherits:
BasicSource
  • Object
show all
Includes:
DiagramSource
Defined in:
lib/asciidoctor-diagram/diagram_source.rb

Overview

A diagram source that retrieves the code for the diagram from the contents of a block.

Instance Attribute Summary

Attributes inherited from BasicSource

#attributes

Instance Method Summary collapse

Methods included from DiagramSource

#attr, #base_dir, #code, #config, #create_image_metadata, #diagram_type, #find_command, #global_attr, #image_name, #resolve_path, #should_process?, #to_s

Methods inherited from BasicSource

#attr, #checksum, #config, #create_image_metadata, #diagram_type, #image_name, #resolve_path, #should_process?

Constructor Details

#initialize(block_processor, parent_block, reader, attributes) ⇒ ReaderSource

Returns a new instance of ReaderSource.



235
236
237
238
# File 'lib/asciidoctor-diagram/diagram_source.rb', line 235

def initialize(block_processor, parent_block, reader, attributes)
  super(block_processor, parent_block, attributes)
  @reader = reader
end

Instance Method Details

#load_codeObject



240
241
242
# File 'lib/asciidoctor-diagram/diagram_source.rb', line 240

def load_code
  @parent_block.apply_subs(@reader.lines, resolve_diagram_subs).join("\n")
end