Class: ArchUnit::Files::FluentApi::DependOnExternalModuleCondition
- Inherits:
-
Object
- Object
- ArchUnit::Files::FluentApi::DependOnExternalModuleCondition
- Includes:
- Common::FluentApi::Checkable
- Defined in:
- lib/archunit/files/fluentapi/depend_on_external_module_condition.rb
Overview
Executable external-module rule with OR-combined module selectors.
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#is_negated ⇒ Object
readonly
Returns the value of attribute is_negated.
-
#module_filters ⇒ Object
readonly
Returns the value of attribute module_filters.
-
#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(builder, module_filters:) ⇒ DependOnExternalModuleCondition
constructor
A new instance of DependOnExternalModuleCondition.
- #matching(module_name, except: nil) ⇒ Object
- #negated? ⇒ Boolean
Methods included from Common::FluentApi::Checkable
Constructor Details
#initialize(builder, module_filters:) ⇒ DependOnExternalModuleCondition
Returns a new instance of DependOnExternalModuleCondition.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition.rb', line 20 def initialize(builder, module_filters:) unless builder.is_a?(DependOnExternalModuleConditionBuilder) raise ArgumentError, 'builder must be a DependOnExternalModuleConditionBuilder' end @builder = builder @project_locator = builder.project_locator @subject_filters = builder.subject_filters @module_filters = immutable_module_filters(module_filters) @is_negated = builder.negated? freeze end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
18 19 20 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition.rb', line 18 def builder @builder end |
#is_negated ⇒ Object (readonly)
Returns the value of attribute is_negated.
18 19 20 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition.rb', line 18 def is_negated @is_negated end |
#module_filters ⇒ Object (readonly)
Returns the value of attribute module_filters.
18 19 20 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition.rb', line 18 def module_filters @module_filters end |
#project_locator ⇒ Object (readonly)
Returns the value of attribute project_locator.
18 19 20 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition.rb', line 18 def project_locator @project_locator end |
#subject_filters ⇒ Object (readonly)
Returns the value of attribute subject_filters.
18 19 20 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition.rb', line 18 def subject_filters @subject_filters end |
Instance Method Details
#matching(module_name, except: nil) ⇒ Object
37 38 39 40 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition.rb', line 37 def matching(module_name, except: nil) filter = Common::RegexFactory.path_matcher(module_name, except:) self.class.new(builder, module_filters: [*module_filters, filter]) end |
#negated? ⇒ Boolean
33 34 35 |
# File 'lib/archunit/files/fluentapi/depend_on_external_module_condition.rb', line 33 def negated? is_negated end |