Module: Sumi::Graphics::Mixtures::Render
- Defined in:
- graphics/lib/sumi/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", **options) ⇒ String
Renders only this element's children.
Instance Method Details
#Render(**options) ⇒ String
214 |
# File 'graphics/lib/sumi/graphics/mixtures/render.rb', line 214 def Render(**) = Renderer.(self, **) |
#RenderChildren(separator = "\n\n", **options) ⇒ 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.
229 230 231 232 233 234 235 |
# File 'graphics/lib/sumi/graphics/mixtures/render.rb', line 229 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") Options.validate(**) children.map { Renderer.fragment(it, **) }.join(separator) end |