Class: Postsvg::Svg::Elements::ClipPath
- Inherits:
-
Postsvg::Svg::Element
- Object
- Postsvg::Svg::Element
- Postsvg::Svg::Elements::ClipPath
- Defined in:
- lib/postsvg/svg/elements/clip_path.rb
Constant Summary collapse
- ELEMENT_NAME =
"clipPath"
Constants inherited from Postsvg::Svg::Element
Postsvg::Svg::Element::REGISTRY
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes inherited from Postsvg::Svg::Element
#attributes, #clip_path_id, #fill, #stroke, #stroke_paint, #transform
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, children: [], **rest) ⇒ ClipPath
constructor
A new instance of ClipPath.
Methods inherited from Postsvg::Svg::Element
#default_fill, #element_name, register, registry
Constructor Details
#initialize(id:, children: [], **rest) ⇒ ClipPath
Returns a new instance of ClipPath.
12 13 14 15 16 |
# File 'lib/postsvg/svg/elements/clip_path.rb', line 12 def initialize(id:, children: [], **rest) super(**rest) @id = id @children = children.freeze end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
10 11 12 |
# File 'lib/postsvg/svg/elements/clip_path.rb', line 10 def children @children end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/postsvg/svg/elements/clip_path.rb', line 10 def id @id end |
Class Method Details
.from_node(node) ⇒ Object
18 19 20 21 22 |
# File 'lib/postsvg/svg/elements/clip_path.rb', line 18 def self.from_node(node) new(id: node["id"], children: node.element_children.map { |c| Element.from_node(c) }, attributes: Elements.node_attributes(node)) end |