Class: Filter::Matchers::Array
- Defined in:
- lib/filter/matchers/array.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #===(other) ⇒ Object
-
#initialize(pattern) ⇒ Array
constructor
A new instance of Array.
Methods inherited from Base
Constructor Details
#initialize(pattern) ⇒ Array
Returns a new instance of Array.
4 5 6 |
# File 'lib/filter/matchers/array.rb', line 4 def initialize(pattern) @pattern = pattern.map(&:to_proc) end |
Instance Method Details
#===(other) ⇒ Object
8 9 10 |
# File 'lib/filter/matchers/array.rb', line 8 def ===(other) pattern.all? { |p| p === other } end |