Class: Sevgi::Graphics::Mixtures::Render::Renderer::Inlines Private
- Inherits:
-
Object
- Object
- Sevgi::Graphics::Mixtures::Render::Renderer::Inlines
- Defined in:
- lib/sevgi/graphics/mixtures/render.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Inline-content output splice helper.
Defined Under Namespace
Classes: Mark
Instance Method Summary collapse
-
#initialize ⇒ void
constructor
private
Creates an inline splice tracker.
-
#join(output, indent:, separator:) ⇒ Array<Array<String>, nil>?
private
Joins marked output ranges into inline content.
-
#start(index, depth) ⇒ Sevgi::Graphics::Mixtures::Render::Renderer::Inlines::Mark
private
Starts an inline splice range.
-
#stop(index) ⇒ Integer
private
Ends the innermost inline splice range.
Constructor Details
#initialize ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates an inline splice tracker.
107 108 109 110 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 107 def initialize @marks = [] @stack = [] end |
Instance Method Details
#join(output, indent:, separator:) ⇒ Array<Array<String>, nil>?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Joins marked output ranges into inline content.
140 141 142 143 144 145 146 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 140 def join(output, indent:, separator:) return if @marks.empty? @marks.reverse_each { |mark| join_mark(output, mark, indent:, separator:) } output.compact! end |
#start(index, depth) ⇒ Sevgi::Graphics::Mixtures::Render::Renderer::Inlines::Mark
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Starts an inline splice range.
116 117 118 119 120 121 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 116 def start(index, depth) Mark.new(start: index, depth:).tap do |mark| @marks << mark @stack << mark end end |
#stop(index) ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Ends the innermost inline splice range.
127 128 129 130 131 132 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 127 def stop(index) mark = @stack.pop PanicError.("Inline content range was not opened") unless mark mark.stop = index end |