Class: Emfsvg::Svg::Elements::Polyline

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

Overview

Constant Summary collapse

ELEMENT_NAME =
"polyline"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_pathObject (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

#fillObject (readonly)

Returns the value of attribute fill.



11
12
13
# File 'lib/emfsvg/svg/elements/polyline.rb', line 11

def fill
  @fill
end

#pointsObject (readonly)

Returns the value of attribute points.



11
12
13
# File 'lib/emfsvg/svg/elements/polyline.rb', line 11

def points
  @points
end

#strokeObject (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