Class: Ea::Svg::EaEmitter::Markers
- Inherits:
-
Object
- Object
- Ea::Svg::EaEmitter::Markers
- Defined in:
- lib/ea/svg/ea_emitter/markers.rb
Overview
Emits arrow / diamond markers per connector, matching EA's convention:
- Association (navigable): filled triangle at target
- Generalization: open triangle at target
- Realization: open triangle at target (path dashed)
- Dependency: open arrow at target (path dashed)
- Aggregation (source): open diamond at source
- Composition (source): filled diamond at source
Constant Summary collapse
- ARROW_SIZE =
10
Instance Attribute Summary collapse
-
#diagram ⇒ Object
readonly
Returns the value of attribute diagram.
-
#model_index ⇒ Object
readonly
Returns the value of attribute model_index.
Instance Method Summary collapse
-
#initialize(diagram, model_index:) ⇒ Markers
constructor
A new instance of Markers.
- #render ⇒ Object
Constructor Details
#initialize(diagram, model_index:) ⇒ Markers
Returns a new instance of Markers.
19 20 21 22 |
# File 'lib/ea/svg/ea_emitter/markers.rb', line 19 def initialize(diagram, model_index:) @diagram = diagram @model_index = model_index end |
Instance Attribute Details
#diagram ⇒ Object (readonly)
Returns the value of attribute diagram.
17 18 19 |
# File 'lib/ea/svg/ea_emitter/markers.rb', line 17 def diagram @diagram end |
#model_index ⇒ Object (readonly)
Returns the value of attribute model_index.
17 18 19 |
# File 'lib/ea/svg/ea_emitter/markers.rb', line 17 def model_index @model_index end |
Instance Method Details
#render ⇒ Object
24 25 26 27 28 29 |
# File 'lib/ea/svg/ea_emitter/markers.rb', line 24 def render polys = visible_connectors.filter_map { |c| polygon_for(c) } return "" if polys.empty? polys.join("\n") end |