Class: Emfsvg::Svg::Elements::Defs

Inherits:
Emfsvg::Svg::Element show all
Defined in:
lib/emfsvg/svg/elements/defs.rb

Overview

: container for reusable definitions (clipPath, etc.). Children are NOT rendered directly; they are referenced by id.

Constant Summary collapse

ELEMENT_NAME =
"defs"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Emfsvg::Svg::Element

#clip_path, #element_name, register

Constructor Details

#initialize(children:) ⇒ Defs

Returns a new instance of Defs.



14
15
16
# File 'lib/emfsvg/svg/elements/defs.rb', line 14

def initialize(children:)
  @children = children
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



12
13
14
# File 'lib/emfsvg/svg/elements/defs.rb', line 12

def children
  @children
end

Class Method Details

.from_node(node) ⇒ Object



18
19
20
# File 'lib/emfsvg/svg/elements/defs.rb', line 18

def self.from_node(node)
  new(children: node.element_children.map { |c| Element.from_node(c) })
end