def render(object, fields, view = nil, context: Attributor::DEFAULT_ROOT_CONTEXT)
      if fields.is_a? Array
        sub_fields = fields[0]
        object.each_with_index.collect do |sub_object, i|
          sub_context = context + ["at(#{i})"]
          render(sub_object, sub_fields, view, context: sub_context)
        end
      elsif object.is_a? Praxis::Blueprint
        @cache[object.object_id][fields.object_id] ||= _render(object, fields, view, context: context)
      else
        _render(object, fields, view, context: context)
      end
    rescue SystemStackError
      raise CircularRenderingError.new(object, context)
    end
def render(object, fields, view = nil, context: Attributor::DEFAULT_ROOT_CONTEXT)
      if fields.is_a? Array
        sub_fields = fields[0]
        object.each_with_index.collect do |sub_object, i|
          sub_context = context + ["at(#{i})"]
          render(sub_object, sub_fields, view, context: sub_context)
        end
      elsif object.is_a? Praxis::Blueprint
        @cache[object.object_id][fields.object_id] ||= _render(object, fields, view, context: context)
      else
        _render(object, fields, view, context: context)
      end
    rescue SystemStackError
      raise CircularRenderingError.new(object, context)
    end
Renders an object using a given list of fields.

 @param [Object] object the object to render
 @param [Hash] fields the correct set of fields, as from FieldExpander