Class: Emfsvg::Svg::Elements::Polyline
- Inherits:
-
Emfsvg::Svg::Element
- Object
- Emfsvg::Svg::Element
- Emfsvg::Svg::Elements::Polyline
- Defined in:
- lib/emfsvg/svg/elements/polyline.rb
Overview
Constant Summary collapse
- ELEMENT_NAME =
"polyline"
Instance Attribute Summary collapse
-
#clip_path ⇒ Object
readonly
Returns the value of attribute clip_path.
-
#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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(points:, fill:, stroke:, clip_path: nil) ⇒ Polyline
constructor
A new instance of Polyline.
Methods inherited from Emfsvg::Svg::Element
#children, #element_name, register
Constructor Details
#initialize(points:, fill:, stroke:, clip_path: nil) ⇒ Polyline
Returns a new instance of Polyline.
13 14 15 16 17 18 |
# File 'lib/emfsvg/svg/elements/polyline.rb', line 13 def initialize(points:, fill:, stroke:, clip_path: nil) @points = points @fill = fill @stroke = stroke @clip_path = clip_path end |
Instance Attribute Details
#clip_path ⇒ Object (readonly)
Returns the value of attribute clip_path.
11 12 13 |
# File 'lib/emfsvg/svg/elements/polyline.rb', line 11 def clip_path @clip_path end |
#fill ⇒ Object (readonly)
Returns the value of attribute fill.
11 12 13 |
# File 'lib/emfsvg/svg/elements/polyline.rb', line 11 def fill @fill end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
11 12 13 |
# File 'lib/emfsvg/svg/elements/polyline.rb', line 11 def points @points end |
#stroke ⇒ Object (readonly)
Returns the value of attribute stroke.
11 12 13 |
# File 'lib/emfsvg/svg/elements/polyline.rb', line 11 def stroke @stroke end |
Class Method Details
.from_node(node) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/emfsvg/svg/elements/polyline.rb', line 20 def self.from_node(node) new( points: AttributeParser.points(node["points"]), **Stylable.parse_style(node) ) end |