Class: MemDB::Field::Enum::MultiMatching
- Inherits:
-
Object
- Object
- MemDB::Field::Enum::MultiMatching
- Includes:
- Matching
- Defined in:
- lib/mem_db/field/enum.rb
Instance Method Summary collapse
-
#initialize(arr) ⇒ MultiMatching
constructor
A new instance of MultiMatching.
- #match?(values) ⇒ Boolean
Constructor Details
#initialize(arr) ⇒ MultiMatching
Returns a new instance of MultiMatching.
14 15 16 |
# File 'lib/mem_db/field/enum.rb', line 14 def initialize(arr) @arr = arr end |
Instance Method Details
#match?(values) ⇒ Boolean
18 19 20 |
# File 'lib/mem_db/field/enum.rb', line 18 def match?(values) values.any? { |el| @arr.include?(el) } end |