Class: MemDB::Field::Pattern::SingleMatching

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

Instance Method Summary collapse

Constructor Details

#initialize(el, rx_engine:) ⇒ SingleMatching

Returns a new instance of SingleMatching.



94
95
96
# File 'lib/mem_db/field/pattern.rb', line 94

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

Instance Method Details

#match?(values) ⇒ Boolean

Returns:

  • (Boolean)


98
99
100
# File 'lib/mem_db/field/pattern.rb', line 98

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