Class: ArchUnit::Slices::Uml::PlantUmlDiagram

Inherits:
Data
  • Object
show all
Defined in:
lib/archunit/slices/uml/plant_uml_diagram.rb

Overview

Immutable component names and allowed directed dependencies parsed from PlantUML.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(components: [], dependencies: []) ⇒ PlantUmlDiagram

Returns a new instance of PlantUmlDiagram.



11
12
13
14
15
# File 'lib/archunit/slices/uml/plant_uml_diagram.rb', line 11

def initialize(components: [], dependencies: [])
  dependencies = immutable_dependencies(dependencies)
  components = immutable_components(components, dependencies)
  super
end

Instance Attribute Details

#componentsObject (readonly)

Returns the value of attribute components

Returns:

  • (Object)

    the current value of components



10
11
12
# File 'lib/archunit/slices/uml/plant_uml_diagram.rb', line 10

def components
  @components
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies

Returns:

  • (Object)

    the current value of dependencies



10
11
12
# File 'lib/archunit/slices/uml/plant_uml_diagram.rb', line 10

def dependencies
  @dependencies
end

Instance Method Details

#allows?(source, target) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/archunit/slices/uml/plant_uml_diagram.rb', line 17

def allows?(source, target)
  dependencies.include?(PlantUmlDependency.new(source:, target:))
end