Sha256: fe914d5852ee3a0bf7307100ee0eb45fe20b9d41552efb419918940ba252f5be

Contents?: true

Size: 345 Bytes

Versions: 2

Compression:

Stored size: 345 Bytes

Contents

module JSONSelect::Ast::SimpleSelector
  
  def to_ast
    ast = {}
    
    if respond_to?(:a) and respond_to?(:b)
      ast.merge! a.to_ast
      
      b.elements.each do |s|
        ast.merge!(s.to_ast)
      end
      
    else
      self.elements.each do |s|
        ast.merge!(s.to_ast)
      end
      
    end
    
    ast
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
json_select-0.1.1 lib/json_select/ast/simple_selector.rb
json_select-0.1.0 lib/json_select/ast/simple_selector.rb