Class: ArchUnit::Files::FluentApi::DependOnExternalModuleConditionBuilder
- Inherits:
-
Object
- Object
- ArchUnit::Files::FluentApi::DependOnExternalModuleConditionBuilder
- Defined in:
- lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb
Overview
Immutable object stage selecting external dependency names.
Instance Attribute Summary collapse
-
#is_negated ⇒ Object
readonly
Returns the value of attribute is_negated.
-
#mood ⇒ Object
readonly
Returns the value of attribute mood.
-
#project_locator ⇒ Object
readonly
Returns the value of attribute project_locator.
-
#subject_filters ⇒ Object
readonly
Returns the value of attribute subject_filters.
Instance Method Summary collapse
-
#initialize(mood) ⇒ DependOnExternalModuleConditionBuilder
constructor
A new instance of DependOnExternalModuleConditionBuilder.
- #matching(module_name, except: nil) ⇒ Object
- #negated? ⇒ Boolean
Constructor Details
#initialize(mood) ⇒ DependOnExternalModuleConditionBuilder
Returns a new instance of DependOnExternalModuleConditionBuilder.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb', line 13 def initialize(mood) unless mood.is_a?(MatchPatternFileConditionBuilder) raise ArgumentError, 'mood must be a file condition builder' end @mood = mood @project_locator = mood.project_locator @subject_filters = mood.filters @is_negated = mood.negated? freeze end |
Instance Attribute Details
#is_negated ⇒ Object (readonly)
Returns the value of attribute is_negated.
11 12 13 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb', line 11 def is_negated @is_negated end |
#mood ⇒ Object (readonly)
Returns the value of attribute mood.
11 12 13 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb', line 11 def mood @mood end |
#project_locator ⇒ Object (readonly)
Returns the value of attribute project_locator.
11 12 13 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb', line 11 def project_locator @project_locator end |
#subject_filters ⇒ Object (readonly)
Returns the value of attribute subject_filters.
11 12 13 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb', line 11 def subject_filters @subject_filters end |
Instance Method Details
#matching(module_name, except: nil) ⇒ Object
29 30 31 32 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb', line 29 def matching(module_name, except: nil) filter = Common::RegexFactory.path_matcher(module_name, except:) DependOnExternalModuleCondition.new(self, module_filters: [filter]) end |
#negated? ⇒ Boolean
25 26 27 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb', line 25 def negated? is_negated end |