Class: ArchUnit::Common::Filter

Inherits:
Data
  • Object
show all
Defined in:
lib/archunit/common/filter.rb

Overview

An immutable regular-expression filter with its matching target and exclusions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regexp:, target:, matching: :partial, exclusions: []) ⇒ Filter

Returns a new instance of Filter.



12
13
14
15
16
17
18
19
# File 'lib/archunit/common/filter.rb', line 12

def initialize(regexp:, target:, matching: :partial, exclusions: [])
  regexp = immutable_regexp(regexp)
  validate_member(target, FILTER_TARGETS, :target)
  validate_member(matching, FILTER_MATCHING_MODES, :matching)
  exclusions = immutable_exclusions(exclusions)

  super
end

Instance Attribute Details

#exclusionsObject (readonly)

Returns the value of attribute exclusions

Returns:

  • (Object)

    the current value of exclusions



11
12
13
# File 'lib/archunit/common/filter.rb', line 11

def exclusions
  @exclusions
end

#matchingObject (readonly)

Returns the value of attribute matching

Returns:

  • (Object)

    the current value of matching



11
12
13
# File 'lib/archunit/common/filter.rb', line 11

def matching
  @matching
end

#regexpObject (readonly)

Returns the value of attribute regexp

Returns:

  • (Object)

    the current value of regexp



11
12
13
# File 'lib/archunit/common/filter.rb', line 11

def regexp
  @regexp
end

#targetObject (readonly)

Returns the value of attribute target

Returns:

  • (Object)

    the current value of target



11
12
13
# File 'lib/archunit/common/filter.rb', line 11

def target
  @target
end