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