Class: MemDB::Field::Pattern::MultiMatching
- Inherits:
-
Object
- Object
- MemDB::Field::Pattern::MultiMatching
- Includes:
- Matching
- Defined in:
- lib/mem_db/field/pattern.rb
Instance Method Summary collapse
-
#initialize(arr, rx_engine:) ⇒ MultiMatching
constructor
A new instance of MultiMatching.
- #match?(values) ⇒ Boolean
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
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 |