Class: Arelastic::Nodes::HashGroup

Inherits:
Node
  • Object
show all
Defined in:
lib/arelastic/nodes/hash_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #convert_to_elastic, #read_option!

Methods included from Arities::Binary

#binary

Methods included from Arities::Polyadic

#polyadic

Methods included from Arities::Unary

#unary

Constructor Details

#initialize(nodes) ⇒ HashGroup

Returns a new instance of HashGroup.



5
6
7
# File 'lib/arelastic/nodes/hash_group.rb', line 5

def initialize nodes
  @nodes = nodes
end

Instance Attribute Details

#nodesObject

Returns the value of attribute nodes.



4
5
6
# File 'lib/arelastic/nodes/hash_group.rb', line 4

def nodes
  @nodes
end

Instance Method Details

#as_elasticObject



9
10
11
12
13
# File 'lib/arelastic/nodes/hash_group.rb', line 9

def as_elastic
  nodes.each_with_object({}) do |node, result|
    result.merge! convert_to_elastic(node)
  end
end