Class: ArchUnit::Slices::Assertion::SliceDependencyViolation
- Inherits:
-
Common::Assertion::Violation
- Object
- Common::Assertion::Violation
- ArchUnit::Slices::Assertion::SliceDependencyViolation
- Defined in:
- lib/archunit/slices/assertion/slice_dependency_violation.rb
Overview
Structured evidence for a dependency rejected by a slice rule.
Constant Summary collapse
- RULES =
%i[contain_dependency adhere_to_diagram].freeze
Instance Attribute Summary collapse
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#is_negated ⇒ Object
readonly
Returns the value of attribute is_negated.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#source_slice ⇒ Object
readonly
Returns the value of attribute source_slice.
-
#target_slice ⇒ Object
readonly
Returns the value of attribute target_slice.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(dependency:, source_slice:, target_slice:, rule:, is_negated:) ⇒ SliceDependencyViolation
constructor
A new instance of SliceDependencyViolation.
- #negated? ⇒ Boolean
Constructor Details
#initialize(dependency:, source_slice:, target_slice:, rule:, is_negated:) ⇒ SliceDependencyViolation
Returns a new instance of SliceDependencyViolation.
16 17 18 19 20 21 22 23 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 16 def initialize(dependency:, source_slice:, target_slice:, rule:, is_negated:) @dependency = projected_edge(dependency) @source_slice = slice_name(source_slice, :source_slice) @target_slice = slice_name(target_slice, :target_slice) @rule = rule_value(rule) @is_negated = boolean(is_negated, :is_negated) super() end |
Instance Attribute Details
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
14 15 16 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 14 def dependency @dependency end |
#is_negated ⇒ Object (readonly)
Returns the value of attribute is_negated.
14 15 16 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 14 def is_negated @is_negated end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
14 15 16 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 14 def rule @rule end |
#source_slice ⇒ Object (readonly)
Returns the value of attribute source_slice.
14 15 16 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 14 def source_slice @source_slice end |
#target_slice ⇒ Object (readonly)
Returns the value of attribute target_slice.
14 15 16 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 14 def target_slice @target_slice end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
29 30 31 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 29 def ==(other) other.is_a?(self.class) && values == other.send(:values) end |
#hash ⇒ Object
34 35 36 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 34 def hash [self.class, *values].hash end |
#negated? ⇒ Boolean
25 26 27 |
# File 'lib/archunit/slices/assertion/slice_dependency_violation.rb', line 25 def negated? is_negated end |