Class: ArchUnit::Files::Assertion::FileDependencyViolation
- Inherits:
-
Common::Assertion::Violation
- Object
- Common::Assertion::Violation
- ArchUnit::Files::Assertion::FileDependencyViolation
- Defined in:
- lib/archunit/files/assertion/depend_on_files.rb
Overview
Data describing an internal file dependency that disagrees with a rule.
Instance Attribute Summary collapse
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#is_negated ⇒ Object
readonly
Returns the value of attribute is_negated.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(dependency:, is_negated: false) ⇒ FileDependencyViolation
constructor
A new instance of FileDependencyViolation.
- #negated? ⇒ Boolean
Constructor Details
#initialize(dependency:, is_negated: false) ⇒ FileDependencyViolation
Returns a new instance of FileDependencyViolation.
16 17 18 19 20 |
# File 'lib/archunit/files/assertion/depend_on_files.rb', line 16 def initialize(dependency:, is_negated: false) @dependency = projected_edge(dependency) @is_negated = boolean_value(is_negated) super() end |
Instance Attribute Details
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
14 15 16 |
# File 'lib/archunit/files/assertion/depend_on_files.rb', line 14 def dependency @dependency end |
#is_negated ⇒ Object (readonly)
Returns the value of attribute is_negated.
14 15 16 |
# File 'lib/archunit/files/assertion/depend_on_files.rb', line 14 def is_negated @is_negated end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
26 27 28 29 30 |
# File 'lib/archunit/files/assertion/depend_on_files.rb', line 26 def ==(other) other.is_a?(self.class) && dependency == other.dependency && is_negated == other.is_negated end |
#hash ⇒ Object
33 34 35 |
# File 'lib/archunit/files/assertion/depend_on_files.rb', line 33 def hash [self.class, dependency, is_negated].hash end |
#negated? ⇒ Boolean
22 23 24 |
# File 'lib/archunit/files/assertion/depend_on_files.rb', line 22 def negated? is_negated end |