Class: MemDB::Field::Regexp::SingleMatching

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

Instance Method Summary collapse

Constructor Details

#initialize(el, rx_engine:, ignore_case:) ⇒ SingleMatching

Returns a new instance of SingleMatching.



27
28
29
# File 'lib/mem_db/field/regexp.rb', line 27

def initialize(el, rx_engine:, ignore_case:)
  @pat = rx_engine.new(el, ignore_case: ignore_case)
end

Instance Method Details

#match?(values) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/mem_db/field/regexp.rb', line 31

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