Class: Chewy::Query::Nodes::Missing
- Defined in:
- lib/chewy/query/nodes/missing.rb
Instance Method Summary collapse
- #! ⇒ Object
- #__render__ ⇒ Object
-
#initialize(name, options = {}) ⇒ Missing
constructor
A new instance of Missing.
Methods inherited from Expr
Methods inherited from Base
Constructor Details
#initialize(name, options = {}) ⇒ Missing
Returns a new instance of Missing.
5 6 7 8 |
# File 'lib/chewy/query/nodes/missing.rb', line 5 def initialize name, = {} @name = name.to_s @options = .reverse_merge(existence: true, null_value: false) end |
Instance Method Details
#! ⇒ Object
10 11 12 |
# File 'lib/chewy/query/nodes/missing.rb', line 10 def ! Nodes::Exists.new @name end |
#__render__ ⇒ Object
14 15 16 |
# File 'lib/chewy/query/nodes/missing.rb', line 14 def __render__ {missing: {field: @name}.merge(@options.slice(:existence, :null_value))} end |