Class: ArchUnit::Files::FluentApi::DependOnFileConditionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb

Overview

Immutable object stage selecting internal dependency targets.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mood) ⇒ DependOnFileConditionBuilder

Returns a new instance of DependOnFileConditionBuilder.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/archunit/files/fluentapi/depend_on_file_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_negatedObject (readonly)

Returns the value of attribute is_negated.



11
12
13
# File 'lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb', line 11

def is_negated
  @is_negated
end

#moodObject (readonly)

Returns the value of attribute mood.



11
12
13
# File 'lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb', line 11

def mood
  @mood
end

#project_locatorObject (readonly)

Returns the value of attribute project_locator.



11
12
13
# File 'lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb', line 11

def project_locator
  @project_locator
end

#subject_filtersObject (readonly)

Returns the value of attribute subject_filters.



11
12
13
# File 'lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb', line 11

def subject_filters
  @subject_filters
end

Instance Method Details

#in_folder(pattern, except: nil) ⇒ Object



33
34
35
# File 'lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb', line 33

def in_folder(pattern, except: nil)
  condition(Common::RegexFactory.folder_matcher(pattern, except:))
end

#in_path(pattern, except: nil) ⇒ Object



37
38
39
# File 'lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb', line 37

def in_path(pattern, except: nil)
  condition(Common::RegexFactory.path_matcher(pattern, except:))
end

#negated?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb', line 25

def negated?
  is_negated
end

#with_name(pattern, except: nil) ⇒ Object



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

def with_name(pattern, except: nil)
  condition(Common::RegexFactory.filename_matcher(pattern, except:))
end