Class: ArchUnit::Files::FluentApi::CustomFileCondition

Inherits:
Object
  • Object
show all
Includes:
Common::FluentApi::Checkable
Defined in:
lib/archunit/files/fluentapi/custom_file_condition.rb

Overview

Executable custom predicate evaluated against immutable FileInfo values.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common::FluentApi::Checkable

#check

Constructor Details

#initialize(mood, condition:, message:) ⇒ CustomFileCondition

Returns a new instance of CustomFileCondition.



19
20
21
22
23
24
25
26
27
# File 'lib/archunit/files/fluentapi/custom_file_condition.rb', line 19

def initialize(mood, condition:, message:)
  validate_mood(mood)
  @project_locator = mood.project_locator
  @subject_filters = mood.filters
  @condition = callable_value(condition)
  @message = message_value(message)
  @is_negated = mood.negated?
  freeze
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



17
18
19
# File 'lib/archunit/files/fluentapi/custom_file_condition.rb', line 17

def condition
  @condition
end

#is_negatedObject (readonly)

Returns the value of attribute is_negated.



17
18
19
# File 'lib/archunit/files/fluentapi/custom_file_condition.rb', line 17

def is_negated
  @is_negated
end

#messageObject (readonly)

Returns the value of attribute message.



17
18
19
# File 'lib/archunit/files/fluentapi/custom_file_condition.rb', line 17

def message
  @message
end

#project_locatorObject (readonly)

Returns the value of attribute project_locator.



17
18
19
# File 'lib/archunit/files/fluentapi/custom_file_condition.rb', line 17

def project_locator
  @project_locator
end

#subject_filtersObject (readonly)

Returns the value of attribute subject_filters.



17
18
19
# File 'lib/archunit/files/fluentapi/custom_file_condition.rb', line 17

def subject_filters
  @subject_filters
end

Instance Method Details

#negated?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/archunit/files/fluentapi/custom_file_condition.rb', line 29

def negated?
  is_negated
end