Class: RightCSV
- Inherits:
-
CSV
- Object
- CSV
- RightCSV
- Defined in:
- lib/rightcsv.rb
Instance Method Summary collapse
- #init_separators ⇒ Object
-
#initialize(data, **options) ⇒ RightCSV
constructor
A new instance of RightCSV.
Constructor Details
#initialize(data, **options) ⇒ RightCSV
Returns a new instance of RightCSV.
14 15 16 |
# File 'lib/rightcsv.rb', line 14 def initialize(data, **) super(data, .merge(nil_value: '')) end |
Instance Method Details
#init_separators ⇒ Object
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 |