Class: Lutaml::Xsd::Spa::Svg::ConnectorRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/xsd/spa/svg/connector_renderer.rb

Overview

Abstract base class for connector renderers Subclasses must implement #render method

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, connector_type) ⇒ ConnectorRenderer

Returns a new instance of ConnectorRenderer.



14
15
16
17
# File 'lib/lutaml/xsd/spa/svg/connector_renderer.rb', line 14

def initialize(config, connector_type)
  @config = config
  @style = config.connectors.for_type(connector_type)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



12
13
14
# File 'lib/lutaml/xsd/spa/svg/connector_renderer.rb', line 12

def config
  @config
end

#styleObject (readonly)

Returns the value of attribute style.



12
13
14
# File 'lib/lutaml/xsd/spa/svg/connector_renderer.rb', line 12

def style
  @style
end

Instance Method Details

#render(from_point, to_point) ⇒ String

Renders a connector from one point to another

Parameters:

Returns:

  • (String)

    SVG markup

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/lutaml/xsd/spa/svg/connector_renderer.rb', line 23

def render(from_point, to_point)
  raise NotImplementedError, "#{self.class} must implement #render"
end