Sha256: 0fcaf3294962879bfd6eee9564a4dad8143bef6afa1ce1ee912d2e4f878ea990

Contents?: true

Size: 390 Bytes

Versions: 6

Compression:

Stored size: 390 Bytes

Contents

module CSVRb
  class PlainBuilder
    def value
      @value ||= "#{}"
    end

    def set(value)
      @value = value
    end

    def stream(row)
      value << CSV.generate_line(row, force_quotes: true, encoding: 'utf-8')
    end

    def <<(row)
      stream(row)
    end

    def close
      to_s
    end

    def to_str
      to_s
    end

    def to_s
      value
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
csv_rb-6.0.2.2 lib/csv_rb/plain_builder.rb
csv_rb-6.0.2.1 lib/csv_rb/plain_builder.rb
csv_rb-5.2.3.2 lib/csv_rb/plain_builder.rb
csv_rb-5.2.3.1 lib/csv_rb/plain_builder.rb
csv_rb-5.2.3 lib/csv_rb/plain_builder.rb
csv_rb-5.2.2 lib/csv_rb/plain_builder.rb