Class: Selector::Not
Overview
The inversion of another condition
Instance Attribute Summary
Attributes inherited from Condition
Class Method Summary collapse
Instance Method Summary collapse
-
#! ⇒ Selector::Condition
Returns the inverted condition (avoids double negation).
-
#[](value) ⇒ Boolean
Checks if the value doesn’t satisfy inverted condition.
Methods inherited from Condition
#&, #-, #==, #attribute, #initialize, #|
Constructor Details
This class inherits a constructor from Selector::Condition
Class Method Details
.new(source) ⇒ Object
10 11 12 13 14 |
# File 'lib/selector/not.rb', line 10 def self.new(source) return NOTHING if source.equal? ANYTHING return ANYTHING if source.equal? NOTHING super end |
Instance Method Details
#! ⇒ Selector::Condition
Returns the inverted condition (avoids double negation)
44 45 46 |
# File 'lib/selector/not.rb', line 44 def ! attribute end |
#[](value) ⇒ Boolean
Checks if the value doesn’t satisfy inverted condition
31 32 33 |
# File 'lib/selector/not.rb', line 31 def [](value) !attribute[value] end |