Class: RightCSV

Inherits:
CSV
  • Object
show all
Defined in:
lib/rightcsv.rb

Instance Method Summary collapse

Constructor Details

#initialize(data, **options) ⇒ RightCSV

Returns a new instance of RightCSV.



14
15
16
# File 'lib/rightcsv.rb', line 14

def initialize(data, **options)
  super(data, options.merge(nil_value: ''))
end

Instance Method Details

#init_separatorsObject



18
19
20
21
22
23
24
25
26
# File 'lib/rightcsv.rb', line 18

def init_separators(*)
  super
  unless @force_quotes
    quote_orig = @quote
    @quote = lambda do |field|
      field.to_s.empty? ? '' : quote_orig.call(field)
    end
  end
end