Module: Sevgi::Derender::Elements::Root Private
- Includes:
- Any
- Defined in:
- lib/sevgi/derender/elements/root.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Element strategy for the SVG root element.
Instance Method Summary collapse
-
#attributes! ⇒ Hash{String => String}
private
Returns root attributes merged with namespace declarations.
-
#decompile(pres = []) ⇒ Array<String>
private
Converts the SVG root into unformatted Sevgi DSL lines.
-
#element ⇒ String
private
Returns the root DSL word.
Instance Method Details
#attributes! ⇒ Hash{String => String}
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.
Returns root attributes merged with namespace declarations.
34 |
# File 'lib/sevgi/derender/elements/root.rb', line 34 def attributes! = {**attributes, **namespaces} |
#decompile(pres = []) ⇒ Array<String>
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.
Converts the SVG root into unformatted Sevgi DSL lines.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/sevgi/derender/elements/root.rb', line 14 def decompile(pres = []) lines = super return lines unless pres&.any? lines.unshift( [ "SVG.document preambles: [", *pres.map { "#{Ruby.literal(it)}," }, "]", "" ] ) end |
#element ⇒ String
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.
Returns the root DSL word.
30 |
# File 'lib/sevgi/derender/elements/root.rb', line 30 def element = "SVG" |