Class: Filter::Or

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

Instance Method Summary collapse

Methods inherited from Condition

#and, #not, #or

Constructor Details

#initialize(*patterns) ⇒ Or

Returns a new instance of Or.



5
6
7
# File 'lib/filter/or.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/or.rb', line 9

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