Class: Postsvg::Translation::Handlers::SvgHandler
- Inherits:
-
Object
- Object
- Postsvg::Translation::Handlers::SvgHandler
- Extended by:
- Shared
- Defined in:
- lib/postsvg/translation/handlers/svg_handler.rb
Class Method Summary collapse
- .call(element, context) ⇒ Object
-
.descend(element, context) ⇒ Object
Walks an element's
childrenusing the default registry.
Methods included from Shared
emit_fill, emit_paint, emit_paint_setup, emit_stroke, emit_transform, expand_bbox
Class Method Details
.call(element, context) ⇒ Object
9 10 11 12 13 |
# File 'lib/postsvg/translation/handlers/svg_handler.rb', line 9 def self.call(element, context) # SVG root: descend into children. Header / viewBox are # captured by the PsRenderer; no records needed here. descend(element, context) end |
.descend(element, context) ⇒ Object
Walks an element's children using the default registry.
Element base class guarantees the children getter.
17 18 19 20 21 |
# File 'lib/postsvg/translation/handlers/svg_handler.rb', line 17 def self.descend(element, context) element.children.each do |child| Postsvg::Translation::PsRenderer.default_registry.translate(child, context) end end |