Class: Filter::Condition

Inherits:
Object
  • Object
show all
Defined in:
lib/filter/condition.rb

Direct Known Subclasses

And, Or

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ Condition

Returns a new instance of Condition.



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

def initialize(pattern)
  @matcher = Filter::Matcher.new(pattern)
end

Instance Method Details

#===(another) ⇒ Object



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

def ===(another)
  @matcher === another
end

#and(other) ⇒ Object Also known as: &



13
14
15
# File 'lib/filter/condition.rb', line 13

def and(other)
  Filter.and(self, other)
end

#or(other) ⇒ Object Also known as: |



18
19
20
# File 'lib/filter/condition.rb', line 18

def or(other)
  Filter.or(self, other)
end