def iterate_type(type = nil)
      if type.nil? || (type.instance_of?(Class) && type == Hash)
        @iterate = :each_row
      elsif type.instance_of?(Class) && type == Array
        @iterate = :each_array
      else
        @iterate = :each_instance
        @type = type
      end
      self
    end
Specify the type to instantiate, or reset to return a Hash.

Explicitly check for type class to prevent calling equality
operator on active record relation, which will load it.