Class: AdvancedSearch::SExp::NodeBuilder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/advanced_search/sexp/node_builder.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(type, *args) ⇒ NodeBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of NodeBuilder.



8
9
10
11
# File 'lib/advanced_search/sexp/node_builder.rb', line 8

def initialize(type, *args)
  @type = type
  @args = args
end

Instance Method Details

#buildObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
19
20
# File 'lib/advanced_search/sexp/node_builder.rb', line 14

def build
  constructor_args, child_nodes = split_args
  # puts [@type, @args, constructor_arity, constructor_args, child_nodes].inspect
  node = node_class.new(*constructor_args)
  add_edges(node, child_nodes)
  node
end