Class: Lutaml::Xsd::Spa::Svg::ConnectorRenderer
- Inherits:
-
Object
- Object
- Lutaml::Xsd::Spa::Svg::ConnectorRenderer
- Defined in:
- lib/lutaml/xsd/spa/svg/connector_renderer.rb
Overview
Abstract base class for connector renderers Subclasses must implement #render method
Direct Known Subclasses
Lutaml::Xsd::Spa::Svg::Connectors::ContainmentConnector, Lutaml::Xsd::Spa::Svg::Connectors::InheritanceConnector, Lutaml::Xsd::Spa::Svg::Connectors::ReferenceConnector
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
Instance Method Summary collapse
-
#initialize(config, connector_type) ⇒ ConnectorRenderer
constructor
A new instance of ConnectorRenderer.
-
#render(from_point, to_point) ⇒ String
Renders a connector from one point to another.
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
#config ⇒ Object (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 |
#style ⇒ Object (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
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 |