Class: ArchUnit::Files::Assertion::FileDependencyViolation

Inherits:
Common::Assertion::Violation show all
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

Instance Method Summary collapse

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

#dependencyObject (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_negatedObject (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

#hashObject



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

Returns:

  • (Boolean)


22
23
24
# File 'lib/archunit/files/assertion/depend_on_files.rb', line 22

def negated?
  is_negated
end