Class: Ea::Svg::EaEmitter::Marker::OpenTriangle

Inherits:
Kind
  • Object
show all
Defined in:
lib/ea/svg/ea_emitter/marker/open_triangle.rb

Overview

Open triangle marker for UML generalization, realization, and dependency. White-filled 3-point polygon at the general / supplier end.

Class Method Summary collapse

Methods inherited from Kind

whole_end_at_source?

Class Method Details

.handles?(effective_type) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ea/svg/ea_emitter/marker/open_triangle.rb', line 11

def self.handles?(effective_type)
  %w[Generalization Realization Dependency].include?(effective_type)
end

.specs_for(connector, source, target, before_target, after_source, relationship: nil) ⇒ Object



15
16
17
18
19
20
# File 'lib/ea/svg/ea_emitter/marker/open_triangle.rb', line 15

def self.specs_for(connector, source, target, before_target, after_source, relationship: nil)
  whole_end_at_source = whole_end_at_source?(connector)
  anchor = whole_end_at_source ? target : source
  base = whole_end_at_source ? before_target : after_source
  [Registry::Spec.new(shape: :triangle, anchor: anchor, base: base)]
end