Class: ParamsReady::Query::Not
- Inherits:
-
Object
- Object
- ParamsReady::Query::Not
- Defined in:
- lib/params_ready/query/predicate_operator.rb
Instance Method Summary collapse
- #altn ⇒ Object
-
#initialize(operator) ⇒ Not
constructor
A new instance of Not.
- #name ⇒ Object
- #test(*args) ⇒ Object
- #to_query(*args) ⇒ Object
Constructor Details
#initialize(operator) ⇒ Not
Returns a new instance of Not.
109 110 111 |
# File 'lib/params_ready/query/predicate_operator.rb', line 109 def initialize(operator) @operator = operator end |
Instance Method Details
#altn ⇒ Object
117 118 119 |
# File 'lib/params_ready/query/predicate_operator.rb', line 117 def altn "n#{@operator.altn}" end |
#name ⇒ Object
113 114 115 |
# File 'lib/params_ready/query/predicate_operator.rb', line 113 def name "not_#{@operator.name}" end |
#test(*args) ⇒ Object
121 122 123 124 |
# File 'lib/params_ready/query/predicate_operator.rb', line 121 def test(*args) result = @operator.test *args !result end |
#to_query(*args) ⇒ Object
126 127 128 129 |
# File 'lib/params_ready/query/predicate_operator.rb', line 126 def to_query(*args) result = @operator.to_query(*args) result.not end |