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.
99 100 101 102 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 99 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.
132 133 134 135 136 137 138 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 132 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.
108 109 110 111 112 113 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 108 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.
119 120 121 122 123 124 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 119 def stop(index) mark = @stack.pop PanicError.("Inline content range was not opened") unless mark mark.stop = index end |