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) ⇒ Object
- #adhere_to_diagram_in_file(path) ⇒ Object
- #ignoring_external_slices ⇒ Object
- #ignoring_orphan_slices ⇒ Object
-
#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) ⇒ Object
35 36 37 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 35 def adhere_to_diagram(text) DiagramSliceCondition.new(scope, DiagramSource.inline(text), options:) end |
#adhere_to_diagram_in_file(path) ⇒ Object
39 40 41 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 39 def adhere_to_diagram_in_file(path) DiagramSliceCondition.new(scope, DiagramSource.file(path), options:) end |
#ignoring_external_slices ⇒ Object
31 32 33 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 31 def ignoring_external_slices copy(.with(ignore_external_slices: true)) end |
#ignoring_orphan_slices ⇒ Object
27 28 29 |
# File 'lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb', line 27 def ignoring_orphan_slices copy(.with(ignore_orphan_slices: true)) end |