Class: ArchUnit::Slices::FluentApi::PositiveSliceConditionBuilder
- Inherits:
-
Object
- Object
- ArchUnit::Slices::FluentApi::PositiveSliceConditionBuilder
- Defined in:
- lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb
Overview
Immutable positive mood and optional modifiers for diagram adherence.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#adhere_to_diagram(text) ⇒ DiagramSliceCondition
Requires the slice graph to match inline PlantUML.
-
#adhere_to_diagram_in_file(path) ⇒ DiagramSliceCondition
Requires the slice graph to match a PlantUML file.
-
#ignoring_external_slices ⇒ PositiveSliceConditionBuilder
Ignores dependencies to external modules during diagram comparison.
-
#ignoring_orphan_slices ⇒ PositiveSliceConditionBuilder
Ignores slices that are absent from the diagram and have no dependency edge.
-
#initialize(scope, options: Assertion::DiagramAdherenceOptions.new) ⇒ PositiveSliceConditionBuilder
constructor
A new instance of PositiveSliceConditionBuilder.
Constructor Details
#initialize(scope, options: Assertion::DiagramAdherenceOptions.new) ⇒ PositiveSliceConditionBuilder
Returns a new instance of PositiveSliceConditionBuilder.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 14 def initialize(scope, options: Assertion::DiagramAdherenceOptions.new) unless scope.is_a?(SliceScopeBuilder) raise ArgumentError, 'scope must be a SliceScopeBuilder' end unless .is_a?(Assertion::DiagramAdherenceOptions) raise ArgumentError, 'options must be DiagramAdherenceOptions' end @scope = scope @options = freeze end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 12 def @options end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
12 13 14 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 12 def scope @scope end |
Instance Method Details
#adhere_to_diagram(text) ⇒ DiagramSliceCondition
Requires the slice graph to match inline PlantUML.
41 42 43 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 41 def adhere_to_diagram(text) DiagramSliceCondition.new(scope, DiagramSource.inline(text), options:) end |
#adhere_to_diagram_in_file(path) ⇒ DiagramSliceCondition
Requires the slice graph to match a PlantUML file.
47 48 49 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 47 def adhere_to_diagram_in_file(path) DiagramSliceCondition.new(scope, DiagramSource.file(path), options:) end |
#ignoring_external_slices ⇒ PositiveSliceConditionBuilder
Ignores dependencies to external modules during diagram comparison.
35 36 37 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 35 def ignoring_external_slices copy(.with(ignore_external_slices: true)) end |
#ignoring_orphan_slices ⇒ PositiveSliceConditionBuilder
Ignores slices that are absent from the diagram and have no dependency edge.
29 30 31 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 29 def ignoring_orphan_slices copy(.with(ignore_orphan_slices: true)) end |
ArchUnitRuby