Class: Elastic::Nodes::Base

Inherits:
Object
  • Object
show all
Includes:
Support::Traversable
Defined in:
lib/elastic/nodes/base.rb

Direct Known Subclasses

And, BaseAgg, Boolean, FunctionScore, Match, Nested, Range, Search, Sort, Term

Instance Method Summary collapse

Methods included from Support::Traversable

#pick_nodes

Instance Method Details

#==(_node) ⇒ Object



5
6
7
# File 'lib/elastic/nodes/base.rb', line 5

def ==(_node)
  render == _node.render
end

#cloneObject



17
18
19
# File 'lib/elastic/nodes/base.rb', line 17

def clone
  self.class.new
end

#handle_result(_raw, _formatter) ⇒ Object



25
26
27
# File 'lib/elastic/nodes/base.rb', line 25

def handle_result(_raw, _formatter)
  _raw
end

#render(_options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/elastic/nodes/base.rb', line 13

def render(_options = {})
  raise NotImplementedError, 'render must be implemented by each node'
end

#simplifyObject



21
22
23
# File 'lib/elastic/nodes/base.rb', line 21

def simplify
  self.class.new
end

#traverse(&_block) ⇒ Object



9
10
11
# File 'lib/elastic/nodes/base.rb', line 9

def traverse(&_block)
  _block.call(self)
end