Sha256: 56ab4698807947993ed922a77e98bef7227416409388bdc5ff6c2c5d6cff4e77

Contents?: true

Size: 524 Bytes

Versions: 17

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

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

module EacCli
  module RunnerWith
    module OutputItem
      class CsvFormatter < ::EacCli::RunnerWith::OutputItem::BaseFormatter
        COLUMNS = %w[key value].freeze

        # @return [String]
        def to_output
          ::CSV.generate do |csv|
            csv << COLUMNS
            item_hash.each { |k, v| csv << [k, v] }
          end
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

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