Class: Asciidoctor::Defmastership::Preprocessor::Helper::DefinitionStringBuilder
- Inherits:
-
Object
- Object
- Asciidoctor::Defmastership::Preprocessor::Helper::DefinitionStringBuilder
- Defined in:
- lib/asciidoctor-defmastership/preprocessor.rb
Overview
Isolate the definition macro
Instance Method Summary collapse
-
#initialize(match, show_explicit_checksum) ⇒ DefinitionStringBuilder
constructor
A new instance of DefinitionStringBuilder.
-
#str_a ⇒ Array<String>
The lines to replace defininition’s line.
Constructor Details
#initialize(match, show_explicit_checksum) ⇒ DefinitionStringBuilder
Returns a new instance of DefinitionStringBuilder.
191 192 193 194 |
# File 'lib/asciidoctor-defmastership/preprocessor.rb', line 191 def initialize(match, show_explicit_checksum) @match = match @show_explicit_checksum = show_explicit_checksum end |
Instance Method Details
#str_a ⇒ Array<String>
Returns the lines to replace defininition’s line.
197 198 199 200 201 202 203 204 205 206 |
# File 'lib/asciidoctor-defmastership/preprocessor.rb', line 197 def str_a explicit_checksum_str = " [.checksum]#(#{@match[:explicit_checksum]})#" if @show_explicit_checksum explicit_version_str = Helper.explicit_version_str(@match[:explicit_version]) labels_str = Helper.labels_str(@match[:labels]) reference = @match[:reference] [ ".#{reference}#{explicit_version_str}#{explicit_checksum_str}#{labels_str}", "[##{reference}.define.#{@match[:type]}]" ] end |