Class: Filter::And

Inherits:
Condition show all
Defined in:
lib/filter/and.rb

Instance Method Summary collapse

Methods inherited from Condition

#and, #or

Constructor Details

#initialize(*patterns) ⇒ And

Returns a new instance of And.



5
6
7
# File 'lib/filter/and.rb', line 5

def initialize(*patterns)
  @matchers = patterns.map { |pattern| Matcher.new(pattern) }
end

Instance Method Details

#===(other) ⇒ Object



9
10
11
# File 'lib/filter/and.rb', line 9

def ===(other)
  @matchers.all? { |m| m === other }
end