lib/tabledata/table.rb
def accessors=(accessors)
      @accessor_columns = {}
      case accessors
        when nil
          # nothing to do
        when Array
          accessors.each_with_index do |name, idx|
            @accessor_columns[name.to_sym] = idx if name
          end
        when Hash
          @accessor_columns = Hash[accessors.map { |name, index| [name.to_sym, index] }]
        else
          raise ArgumentError, "Expected nil, an Array or a Hash, but got #{accessors.class}"
      end
      @accessor_columns.freeze
      @column_accessors  = @accessor_columns.invert.freeze
      @accessors         = @column_accessors.values_at(*0..(@column_accessors.keys.max || -1)).freeze
    end
def accessors=(accessors)
      @accessor_columns = {}
      case accessors
        when nil
          # nothing to do
        when Array
          accessors.each_with_index do |name, idx|
            @accessor_columns[name.to_sym] = idx if name
          end
        when Hash
          @accessor_columns = Hash[accessors.map { |name, index| [name.to_sym, index] }]
        else
          raise ArgumentError, "Expected nil, an Array or a Hash, but got #{accessors.class}"
      end
      @accessor_columns.freeze
      @column_accessors  = @accessor_columns.invert.freeze
      @accessors         = @column_accessors.values_at(*0..(@column_accessors.keys.max || -1)).freeze
    end
@param [Array<Symbol>, Hash<Symbol => Integer>, nil] accessors

 Define the name of the accessors used in Tabledata::Row.
 If you pass in a Hash, it's supposed to be in the form of
 {accessor_name: column_index}.