Class: Asciidoctor::Diagram::Extensions::ReaderSource
- Inherits:
-
BasicSource
- Object
- BasicSource
- Asciidoctor::Diagram::Extensions::ReaderSource
- Includes:
- DiagramSource
- Defined in:
- lib/asciidoctor-diagram/extensions.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
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(parent_block, reader, attributes) ⇒ ReaderSource
constructor
A new instance of ReaderSource.
Methods included from DiagramSource
#attr, #base_dir, #create_image_metadata, #image_name, #should_process?, #to_s
Methods inherited from BasicSource
#attr, #checksum, #create_image_metadata, #image_name, #should_process?
Constructor Details
#initialize(parent_block, reader, attributes) ⇒ ReaderSource
Returns a new instance of ReaderSource.
476 477 478 479 |
# File 'lib/asciidoctor-diagram/extensions.rb', line 476 def initialize(parent_block, reader, attributes) super(parent_block, attributes) @reader = reader end |
Instance Method Details
#code ⇒ Object
481 482 483 |
# File 'lib/asciidoctor-diagram/extensions.rb', line 481 def code @code ||= @parent_block.apply_subs(@reader.lines, resolve_diagram_subs).join("\n") end |