Class: MemDB::Field::Pattern::MultiMatching

Inherits:
Object
  • Object
show all
Includes:
Matching
Defined in:
lib/mem_db/field/pattern.rb

Instance Method Summary collapse

Constructor Details

#initialize(arr, rx_engine:) ⇒ MultiMatching

Returns a new instance of MultiMatching.



82
83
84
# File 'lib/mem_db/field/pattern.rb', line 82

def initialize(arr, rx_engine:)
  @patterns = arr.map { |source| Pattern.new(source, rx_engine: rx_engine) }
end

Instance Method Details

#match?(values) ⇒ Boolean

Returns:

  • (Boolean)


86
87
88
# File 'lib/mem_db/field/pattern.rb', line 86

def match?(values)
  values.any? { |str| @patterns.any? { |pat| pat.match?(str) } }
end