def child(name_or_data, options = {})
      data, name = extract_data_and_name(name_or_data)

      if options.empty? && name_or_data.is_a?(Hash) && new_options = name_or_data.to_a.second
        options = [new_options].to_h
      end

      name = options[:root] if options.key? :root

      if options.key?(:partial)
        attrs = RablCompiler.new(options[:partial]).compile_source
      elsif block_given?
        attrs = sub_compile(data) { yield }
      end

      @attributes.add(name: name, attr: data, nested: attrs.nodes)
    end
def child(name_or_data, options = {})
      data, name = extract_data_and_name(name_or_data)

      if options.empty? && name_or_data.is_a?(Hash) && new_options = name_or_data.to_a.second
        options = [new_options].to_h
      end

      name = options[:root] if options.key? :root

      if options.key?(:partial)
        attrs = RablCompiler.new(options[:partial]).compile_source
      elsif block_given?
        attrs = sub_compile(data) { yield }
      end

      @attributes.add(name: name, attr: data, nested: attrs.nodes)
    end
Creates a child node to be included in the output.
 name_or data can be an object or collection or a method to call on the data. It
 accepts :root and :partial options.
 Notes that partial and blocks are not compatible
 Example:
   child(:@posts, :root => :posts) { attribute :id }
   child(:posts, :partial => 'posts/base')
   child(:@posts => :cool_posts, :root => :posts) { attribute :id }