Class: Chewy::Query::Nodes::Not
- Defined in:
- lib/chewy/query/nodes/not.rb
Instance Method Summary collapse
- #! ⇒ Object
- #__render__ ⇒ Object
-
#initialize(expr, options = {}) ⇒ Not
constructor
A new instance of Not.
Methods inherited from Expr
Methods inherited from Base
Constructor Details
#initialize(expr, options = {}) ⇒ Not
Returns a new instance of Not.
5 6 7 8 |
# File 'lib/chewy/query/nodes/not.rb', line 5 def initialize expr, = {} @expr = expr @options = end |
Instance Method Details
#! ⇒ Object
10 11 12 |
# File 'lib/chewy/query/nodes/not.rb', line 10 def ! @expr end |
#__render__ ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/chewy/query/nodes/not.rb', line 14 def __render__ expr = @expr.__render__ if @options.key?(:cache) {not: {filter: expr, _cache: !!@options[:cache]}} else {not: expr} end end |