Module: Sevgi::Graphics::Mixtures::Identify
- Defined in:
- lib/sevgi/graphics/mixtures/identify.rb
Overview
DSL helpers for collecting and hiding SVG ids.
Defined Under Namespace
Classes: Identifiers
Instance Method Summary collapse
-
#Disidentify ⇒ Sevgi::Graphics::Element
Moves visible id attributes to non-rendering
-idmetadata throughout the subtree. -
#Identifiers ⇒ Sevgi::Graphics::Mixtures::Identify::Identifiers
Builds an immutable id index snapshot for the current element subtree.
Instance Method Details
#Disidentify ⇒ Sevgi::Graphics::Element
Moves visible id attributes to non-rendering -id metadata throughout the subtree.
A pre-existing -id takes precedence over the visible id.
73 74 75 76 77 78 79 80 81 |
# File 'lib/sevgi/graphics/mixtures/identify.rb', line 73 def Disidentify Traverse do |element| next unless element.attributes.has?(:id) id = element.attributes.delete(:id) = :"#{Attributes::META_PREFIX}id" element[] = id unless element.attributes.has?() end end |
#Identifiers ⇒ Sevgi::Graphics::Mixtures::Identify::Identifiers
Builds an immutable id index snapshot for the current element subtree. Rebuild the index to observe later id or tree changes.
86 |
# File 'lib/sevgi/graphics/mixtures/identify.rb', line 86 def Identifiers = Identifiers.new(self) |