123456789_123456789_123456789_123456789_123456789_

Class: CSV::TSV

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ::CSV, Forwardable
Instance Chain:
self, ::CSV, Enumerable
Inherits: CSV
  • Object
Defined in: lib/csv.rb

Constant Summary

::CSV - Inherited

ConverterEncoding, Converters, DEFAULT_OPTIONS, DateMatcher, DateTimeMatcher, HeaderConverters, ON_WINDOWS, VERSION

Class Method Summary

::CSV - Inherited

.filter
  • Parses CSV from a source (String, IO stream, or ARGF).

.foreach

Calls the block with each row read from source path_or_io.

.generate
  • Argument csv_string, if given, must be a String object;.

.generate_line

Returns the String created by generating CSV from ary using the specified options.

.generate_lines

Returns the String created by generating CSV from using the specified options.

.instance

Creates or retrieves cached CSV objects.

.new

Returns the new CSV object created using string or io and the specified options.

.open

possible options elements:

.parse

Parses string or io using the specified options.

.parse_line

Returns the data created by parsing the first line of string or io using the specified options.

.read

Opens the given source with the given options (see open), reads the source (see #read), and returns the result, which will be either an Array of Arrays or a Table.

.readlines

Alias for read.

.table

Calls read with source, options, and certain default options: - #headers: true - #converters: :numeric - #header_converters: :symbol

.create_stringio

See additional method definition at line 1984.

.may_enable_bom_detection_automatically

Instance Attribute Summary

::CSV - Inherited

#binmode?,
#encoding

Returns the encoding used for parsing and generating; see Character Encodings (M17n or Multilingualization):

#eof

Alias for #eof?.

#force_quotes?

Returns the value that determines whether all output fields are to be quoted; used for generating; see Option force_quotes:

#header_row?

Returns true if the next row to be read is a header row; false otherwise.

#liberal_parsing?

Returns the value that determines whether illegal input is to be handled; used for parsing; see Option liberal_parsing:

#return_headers?

Returns the value that determines whether headers are to be returned; used for parsing; see Option return_headers:

#skip_blanks?

Returns the value that determines whether blank lines are to be ignored; used for parsing; see Option skip_blanks:

#unconverted_fields?

Returns the value that determines whether unconverted fields are to be available; used for parsing; see Option unconverted_fields:

#write_headers?

Returns the value that determines whether headers are to be written; used for generating; see Option write_headers:

Instance Method Summary

::CSV - Inherited

#<<

Appends a row to self.

#add_row

Alias for #<<.

#col_sep

Returns the encoded column separator; used for parsing and writing; see Option col_sep:

#convert
  • With no block, installs a field converter (a Proc).

#converters

Returns an Array containing field converters; see Field Converters:

#each

Calls the block with each successive row.

#eof?,
#field_size_limit

Returns the limit for field size; used for parsing; see Option field_size_limit:

#flock,
#gets

Alias for #shift.

#header_convert

The block need not return a String object:

#header_converters

Returns an Array containing header converters; used for parsing; see Header Converters:

#headers

Returns the value that determines whether headers are used; used for parsing; see Option headers:

#inspect

Returns a String showing certain properties of self:

#ioctl,
#line

Returns the line most recently read:

#lineno

Returns the count of the rows parsed or generated.

#max_field_size

Returns the limit for field size; used for parsing; see Option max_field_size:

#path,
#puts

Alias for #<<.

#quote_char

Returns the encoded quote character; used for parsing and writing; see Option quote_char:

#read

Forms the remaining rows from self into: - A Table object, if headers are in use.

#readline

Alias for #shift.

#readlines

Alias for #read.

#rewind

Rewinds the underlying IO object and resets CSV’s lineno() counter.

#row_sep

Returns the encoded row separator; used for parsing and writing; see Option row_sep:

#shift

Returns the next row of data as: - An Array if no headers are used.

#skip_lines

Returns the Regexp used to identify comment lines; used for parsing; see Option skip_lines:

#stat, #to_i, #to_io, #build_fields_converter, #build_header_fields_converter, #build_parser_fields_converter, #build_writer_fields_converter,
#convert_fields

Processes fields with @converters, or @header_converters if #headers is passed as true, returning the converted field set.

#determine_encoding, #header_fields_converter, #normalize_converters, #parser, #parser_enumerator, #parser_fields_converter, #parser_options,
#raw_encoding

Returns the encoding of the internal IO object.

#writer, #writer_fields_converter, #writer_options

Constructor Details

.new(data, **options) ⇒ TSV

[ GitHub ]

  
# File 'lib/csv.rb', line 2133

def initialize(data, **options)
  super(data, **({col_sep: "\t"}.merge(options)))
end