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