Class: Filter::Condition
- Inherits:
-
Object
- Object
- Filter::Condition
- Defined in:
- lib/filter/condition.rb
Instance Method Summary collapse
- #===(another) ⇒ Object
- #and(other) ⇒ Object (also: #&)
-
#initialize(pattern) ⇒ Condition
constructor
A new instance of Condition.
- #not ⇒ Object (also: #~)
- #or(other) ⇒ Object (also: #|)
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 |
#not ⇒ Object Also known as: ~
23 24 25 |
# File 'lib/filter/condition.rb', line 23 def not Filter.not(self) 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 |