Sha256: 25cfdf8d04f698d6c5c81be0c63ebb6ec4afcf97397404c23ea2182b078168b1

Contents?: true

Size: 601 Bytes

Versions: 20

Compression:

Stored size: 601 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| row.send(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

20 entries across 20 versions & 2 rubygems

Version Path
eac_cli-0.40.1 lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_cli-0.40.0 lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_cli-0.39.0 lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_cli-0.38.1 lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.82.0 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.81.0 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.80.0 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.79.0 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.78.0 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.77.1 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.77.0 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_cli-0.38.0 lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.76.1 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.76.0 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.75.2 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_cli-0.37.0 lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.75.1 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.75.0 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_tools-0.74.1 sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb
eac_cli-0.36.0 lib/eac_cli/runner_with/output_list/csv_formatter.rb