Class: Postsvg::Svg::Elements::Polyline
- Inherits:
-
Postsvg::Svg::Element
- Object
- Postsvg::Svg::Element
- Postsvg::Svg::Elements::Polyline
- Defined in:
- lib/postsvg/svg/elements/polyline.rb
Direct Known Subclasses
Constant Summary collapse
- ELEMENT_NAME =
"polyline"
Constants inherited from Postsvg::Svg::Element
Postsvg::Svg::Element::REGISTRY
Instance Attribute Summary collapse
-
#fill ⇒ Object
readonly
Returns the value of attribute fill.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
-
#stroke ⇒ Object
readonly
Returns the value of attribute stroke.
-
#stroke_paint ⇒ Object
readonly
Returns the value of attribute stroke_paint.
Attributes inherited from Postsvg::Svg::Element
#attributes, #children, #clip_path_id, #transform
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(points:, fill:, stroke_paint:, stroke:, **rest) ⇒ Polyline
constructor
A new instance of Polyline.
Methods inherited from Postsvg::Svg::Element
#default_fill, #element_name, register, registry
Constructor Details
#initialize(points:, fill:, stroke_paint:, stroke:, **rest) ⇒ Polyline
Returns a new instance of Polyline.
12 13 14 15 16 17 18 |
# File 'lib/postsvg/svg/elements/polyline.rb', line 12 def initialize(points:, fill:, stroke_paint:, stroke:, **rest) super(**rest) @points = points.freeze @fill = fill @stroke_paint = stroke_paint @stroke = stroke end |
Instance Attribute Details
#fill ⇒ Object (readonly)
Returns the value of attribute fill.
10 11 12 |
# File 'lib/postsvg/svg/elements/polyline.rb', line 10 def fill @fill end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
10 11 12 |
# File 'lib/postsvg/svg/elements/polyline.rb', line 10 def points @points end |
#stroke ⇒ Object (readonly)
Returns the value of attribute stroke.
10 11 12 |
# File 'lib/postsvg/svg/elements/polyline.rb', line 10 def stroke @stroke end |
#stroke_paint ⇒ Object (readonly)
Returns the value of attribute stroke_paint.
10 11 12 |
# File 'lib/postsvg/svg/elements/polyline.rb', line 10 def stroke_paint @stroke_paint end |
Class Method Details
.from_node(node) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/postsvg/svg/elements/polyline.rb', line 20 def self.from_node(node) new(points: AttributeParser.number_list(node["points"]), fill: Paint.parse(node["fill"]), stroke_paint: Paint.parse(node["stroke"]), stroke: Stroke.parse(node), transform: TransformList.parse(node["transform"]), clip_path_id: Elements.parse_clip_path_id(node["clip-path"]), attributes: Elements.node_attributes(node)) end |