Module: JSONSelect::Ast::SelectorGroup

Defined in:
lib/json_select/ast/selector_group.rb

Instance Method Summary collapse

Instance Method Details

#to_astObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/json_select/ast/selector_group.rb', line 3

def to_ast
  if b.elements.empty?
    return a.to_ast
  end
  
  ast = [',', a.to_ast]
  
  b.elements.each do |group|
    ast.push group.c.to_ast
  end
  
  ast
end