lib/csv-diff/csv_source.rb
# Converts an array of field names to an array of indexes of the fields
# matching those names.
Converts an array of field names to an array of indexes of the fields
matching those names.
Converts an array of field names to an array of indexes of the fields matching those names .
def find_field_indexes(key_fields, field_names)
            key_fields.map do |field|
                if field.is_a?(Fixnum)
                    field
                else
                    field_names.index{ |field_name| field.to_s.downcase == field_name.downcase } or
                        raise ArgumentError, "Could not locate field '#{field}' in source field names: #{
                            field_names.join(', ')}"
                end
            end
        end
def find_field_indexes ( key_fields , field_names ) key_fields . map do | field | if field . is_a? ( Fixnum ) field else field_names . index { | field_name | field . to_s . downcase == field_name . downcase } or raise ArgumentError , "Could not locate field '#{field}' in source field names: #{
                            field_names.join(', ')}" end end end
Converts an array of field names to an array of indexes of the fields
matching those names.
Converts an array of field names to an array of indexes of the fields matching those names .
key_fields
<not_specific>
field_names
<not_specific>