Class: Ea::Svg::ConnectorPath
- Inherits:
-
Object
- Object
- Ea::Svg::ConnectorPath
- Defined in:
- lib/ea/svg/connector_path.rb
Overview
Renders one DiagramConnector as an SVG
Instance Attribute Summary collapse
-
#connector ⇒ Object
readonly
Returns the value of attribute connector.
Instance Method Summary collapse
-
#initialize(connector) ⇒ ConnectorPath
constructor
A new instance of ConnectorPath.
- #render ⇒ Object
Constructor Details
#initialize(connector) ⇒ ConnectorPath
Returns a new instance of ConnectorPath.
12 13 14 |
# File 'lib/ea/svg/connector_path.rb', line 12 def initialize(connector) @connector = connector end |
Instance Attribute Details
#connector ⇒ Object (readonly)
Returns the value of attribute connector.
10 11 12 |
# File 'lib/ea/svg/connector_path.rb', line 10 def connector @connector end |
Instance Method Details
#render ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ea/svg/connector_path.rb', line 16 def render points = waypoints return "" if points.empty? <<~SVG.chomp <polyline points="#{points.join(' ')}" fill="none" stroke="#{stroke_color}" stroke-width="#{stroke_width}"/> SVG end |