Class: Locator::Boolean::Terms
- Inherits:
-
Array
- Object
- Array
- Locator::Boolean::Terms
- Defined in:
- lib/locator/boolean.rb
Instance Method Summary collapse
- #and(other) ⇒ Object (also: #&, #|)
- #and!(other) ⇒ Object
- #or(other) ⇒ Object
- #or!(other) ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#and(other) ⇒ Object Also known as: &, |
8 9 10 |
# File 'lib/locator/boolean.rb', line 8 def and(other) other.empty? ? self : And.new(self, other) end |
#and!(other) ⇒ Object
4 5 6 |
# File 'lib/locator/boolean.rb', line 4 def and!(other) replace(self.dup.and(other)) end |
#or(other) ⇒ Object
17 18 19 |
# File 'lib/locator/boolean.rb', line 17 def or(other) other.empty? ? self : Or.new(self, other) end |
#or!(other) ⇒ Object
13 14 15 |
# File 'lib/locator/boolean.rb', line 13 def or!(other) replace(self.dup.or(other)) end |