class ChewyQuery::Builder::Nodes::Not

Public Class Methods

new(expr, options = {}) click to toggle source
# File lib/chewy_query/builder/nodes/not.rb, line 5
def initialize(expr, options = {})
  @expr = expr
  @options = options
end

Public Instance Methods

!() click to toggle source
# File lib/chewy_query/builder/nodes/not.rb, line 10
def !
  @expr
end
__render__() click to toggle source
# File lib/chewy_query/builder/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