Class: Idcf::Cli::Lib::Convert::Formatter::CsvFormat

Inherits:
Base
  • Object
show all
Defined in:
lib/idcf/cli/lib/convert/formatter/csv_format.rb

Overview

csv formatter

Direct Known Subclasses

TableFormat

Instance Method Summary collapse

Instance Method Details

#format(data) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/idcf/cli/lib/convert/formatter/csv_format.rb', line 11

def format(data)
  result = CSV.generate(force_quotes: true) do |csv|
    scrape_line(data).each do |v|
      csv << v
    end
  end

  result.strip
end