Sha256: 9fffa42d87e89ab840508cd1a8c6a6a7453b6692c3ea85f6ea5641f5f795402b

Contents?: true

Size: 976 Bytes

Versions: 20

Compression:

Stored size: 976 Bytes

Contents

====== Option +unconverted_fields+

Specifies the boolean that determines whether unconverted field values are to be available.

Default value:
  CSV::DEFAULT_OPTIONS.fetch(:unconverted_fields) # => nil

The unconverted field values are those found in the source data,
prior to any conversions performed via option +converters+.

When option +unconverted_fields+ is +true+,
each returned row (\Array or \CSV::Row) has an added method,
+unconverted_fields+, that returns the unconverted field values:
  str = <<-EOT
  foo,0
  bar,1
  baz,2
  EOT
  # Without unconverted_fields
  csv = CSV.parse(str, converters: :integer)
  csv # => [["foo", 0], ["bar", 1], ["baz", 2]]
  csv.first.respond_to?(:unconverted_fields) # => false
  # With unconverted_fields
  csv = CSV.parse(str, converters: :integer, unconverted_fields: true)
  csv # => [["foo", 0], ["bar", 1], ["baz", 2]]
  csv.first.respond_to?(:unconverted_fields) # => true
  csv.first.unconverted_fields # => ["foo", "0"]

Version data entries

20 entries across 20 versions & 4 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/csv-3.3.0/doc/csv/options/parsing/unconverted_fields.rdoc
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/csv-3.3.0/doc/csv/options/parsing/unconverted_fields.rdoc
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/csv-3.3.0/doc/csv/options/parsing/unconverted_fields.rdoc
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/csv-3.3.0/doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.3.0 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.9 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.8 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.7 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.6 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.5 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.4 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.3 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.2 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.1 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.2.0 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.1.9 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.1.8 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.1.7 doc/csv/options/parsing/unconverted_fields.rdoc
csv-3.1.6 doc/options/parsing/unconverted_fields.rdoc
csv-3.1.5 doc/unconverted_fields.rdoc