Sha256: 5196379590ec011b488d27245242cd0d44218687c6e181fbba3ed422622d9cb2

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

# frozen_string_literal: true

require 'csv'
require 'eac_ruby_utils/core_ext'
require 'eac_cli/runner_with/output_list/base_formatter'

module EacCli
  module RunnerWith
    module OutputList
      class CsvFormatter < ::EacCli::RunnerWith::OutputList::BaseFormatter
        # @return [Array]
        def build_row(row)
          build_columns.map { |c| build_value(row, c) }
        end

        # @return [String]
        def to_output
          ::CSV.generate do |csv|
            csv << build_columns
            build_rows.each { |row| csv << row }
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eac_cli-0.42.0 lib/eac_cli/runner_with/output_list/csv_formatter.rb