Class: CSV::FieldInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/csv.rb

Overview

A FieldInfo Struct contains details about a field’s position in the data source it was read from. CSV will pass this Struct to some blocks that make decisions based on field structure. See CSV.convert_fields() for an example.

index

The zero-based index of the field in its row.

line

The line of the data source this row is from.

header

The header for the column, when available.

quoted?

True or false, whether the original value is quoted or not.

Instance Attribute Summary collapse

Instance Attribute Details

#headerObject

Returns the value of attribute header

Returns:

  • (Object)

    the current value of header



868
869
870
# File 'lib/csv.rb', line 868

def header
  @header
end

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



868
869
870
# File 'lib/csv.rb', line 868

def index
  @index
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



868
869
870
# File 'lib/csv.rb', line 868

def line
  @line
end

#quoted?Object

Returns the value of attribute quoted?

Returns:

  • (Object)

    the current value of quoted?



868
869
870
# File 'lib/csv.rb', line 868

def quoted?
  @quoted?
end