Class: Arrow::CSVReadOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/csv-read-options.rb

Instance Method Summary collapse

Instance Method Details

#add_column_type(name, type) ⇒ Object



21
22
23
# File 'lib/arrow/csv-read-options.rb', line 21

def add_column_type(name, type)
  add_column_type_raw(name, DataType.resolve(type))
end

#add_column_type_rawObject



20
# File 'lib/arrow/csv-read-options.rb', line 20

alias_method :add_column_type_raw, :add_column_type

#delimiterObject



26
27
28
# File 'lib/arrow/csv-read-options.rb', line 26

def delimiter
  delimiter_raw.chr
end

#delimiter=(delimiter) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/arrow/csv-read-options.rb', line 31

def delimiter=(delimiter)
  case delimiter
  when String
    if delimiter.bytesize != 1
      message = "delimiter must be 1 byte character: #{delimiter.inspect}"
      raise ArgumentError, message
    end
    delimiter = delimiter.ord
  end
  self.delimiter_raw = delimiter
end

#delimiter_rawObject



25
# File 'lib/arrow/csv-read-options.rb', line 25

alias_method :delimiter_raw, :delimiter

#delimiter_raw=Object



30
# File 'lib/arrow/csv-read-options.rb', line 30

alias_method :delimiter_raw=, :delimiter=