Module: Sevgi::Graphics::Mixtures::Render
- Defined in:
- lib/sevgi/graphics/mixtures/render.rb
Overview
DSL helpers for rendering SVG documents and children.
Instance Method Summary collapse
-
#Render(**options) ⇒ String
Renders this element as SVG source.
-
#RenderChildren(separator = "\n\n") ⇒ String
Renders only this element's children.
Instance Method Details
#Render(**options) ⇒ String
361 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 361 def Render(**) = Renderer.(self, **) |
#RenderChildren(separator = "\n\n") ⇒ String
Renders only this element's children. Child render output omits document preambles and preserves each child's text whitespace and inline mixed-content formatting.
369 370 371 372 373 374 |
# File 'lib/sevgi/graphics/mixtures/render.rb', line 369 def RenderChildren(separator = "\n\n") ArgumentError.("SVG fragment separator must be a String") unless separator.is_a?(::String) separator = XML.text(separator, context: "SVG fragment separator") children.map { Renderer.fragment(it) }.join(separator) end |