Module: Sevgi::Graphics::Mixtures::Underscore
- Defined in:
- lib/sevgi/graphics/mixtures/underscore.rb
Overview
DSL helpers for floating text, comments, and inherited internal attributes.
Instance Method Summary collapse
-
#_(*contents) ⇒ Sevgi::Graphics::Element
Creates a floating content element.
-
#Ancestral ⇒ Hash
Merges internal ancestral attributes from the document root to this element.
-
#Comment(comment) ⇒ Sevgi::Graphics::Element
Adds an XML comment.
Instance Method Details
#_(*contents) ⇒ Sevgi::Graphics::Element
Creates a floating content element.
11 12 13 |
# File 'lib/sevgi/graphics/mixtures/underscore.rb', line 11 def _(*contents) Element(:_, *contents) end |
#Ancestral ⇒ Hash
Merges internal ancestral attributes from the document root to this element.
24 25 26 27 28 |
# File 'lib/sevgi/graphics/mixtures/underscore.rb', line 24 def Ancestral {}.tap do |result| Root().Traverse() { |element| result.merge!(element[:_]) if element.has?(:_) } end end |
#Comment(comment) ⇒ Sevgi::Graphics::Element
Adds an XML comment.
18 19 20 |
# File 'lib/sevgi/graphics/mixtures/underscore.rb', line 18 def Comment(comment) _(Content.verbatim("<!-- #{comment} -->")) end |