Class: ArchUnit::Files::Assertion::FilePatternViolation

Inherits:
Common::Assertion::Violation show all
Defined in:
lib/archunit/files/assertion/matching_files.rb

Overview

Data describing a selected file that disagrees with a pattern predicate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(check_filter:, projected_node:, is_negated: false) ⇒ FilePatternViolation

Returns a new instance of FilePatternViolation.



16
17
18
19
20
21
# File 'lib/archunit/files/assertion/matching_files.rb', line 16

def initialize(check_filter:, projected_node:, is_negated: false)
  @check_filter = filter_value(check_filter)
  @projected_node = node_value(projected_node)
  @is_negated = boolean_value(is_negated)
  super()
end

Instance Attribute Details

#check_filterObject (readonly)

Returns the value of attribute check_filter.



14
15
16
# File 'lib/archunit/files/assertion/matching_files.rb', line 14

def check_filter
  @check_filter
end

#is_negatedObject (readonly)

Returns the value of attribute is_negated.



14
15
16
# File 'lib/archunit/files/assertion/matching_files.rb', line 14

def is_negated
  @is_negated
end

#projected_nodeObject (readonly)

Returns the value of attribute projected_node.



14
15
16
# File 'lib/archunit/files/assertion/matching_files.rb', line 14

def projected_node
  @projected_node
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



27
28
29
30
31
32
# File 'lib/archunit/files/assertion/matching_files.rb', line 27

def ==(other)
  other.is_a?(self.class) &&
    check_filter == other.check_filter &&
    projected_node == other.projected_node &&
    is_negated == other.is_negated
end

#hashObject



35
36
37
# File 'lib/archunit/files/assertion/matching_files.rb', line 35

def hash
  [self.class, check_filter, projected_node, is_negated].hash
end

#negated?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/archunit/files/assertion/matching_files.rb', line 23

def negated?
  is_negated
end