Class: MemDB::Field::Regexp::SingleMatching
- Inherits:
-
Object
- Object
- MemDB::Field::Regexp::SingleMatching
- Includes:
- Matching
- Defined in:
- lib/mem_db/field/regexp.rb
Instance Method Summary collapse
-
#initialize(el, rx_engine:, ignore_case:) ⇒ SingleMatching
constructor
A new instance of SingleMatching.
- #match?(values) ⇒ Boolean
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
31 32 33 |
# File 'lib/mem_db/field/regexp.rb', line 31 def match?(values) values.any? { |str| @pat.match?(str) } end |