Module: EacCli::RunnerWith::OutputItem

Defined in:
lib/eac_cli/runner_with/output_item.rb,
lib/eac_cli/runner_with/output_item/csv_formatter.rb,
lib/eac_cli/runner_with/output_item/base_formatter.rb,
lib/eac_cli/runner_with/output_item/yaml_formatter.rb

Defined Under Namespace

Classes: BaseFormatter, CsvFormatter, YamlFormatter

Constant Summary collapse

FORMATS =
{
  'csv' => ::EacCli::RunnerWith::OutputItem::CsvFormatter,
  'yaml' => ::EacCli::RunnerWith::OutputItem::YamlFormatter
}.freeze

Instance Method Summary collapse

Instance Method Details

#formatterEacCli::RunnerWith::OutputList::BaseFormatter



28
29
30
# File 'lib/eac_cli/runner_with/output_item.rb', line 28

def formatter
  formatter_class.new(item_hash)
end

#formatter_classClass



33
34
35
# File 'lib/eac_cli/runner_with/output_item.rb', line 33

def formatter_class
  FORMATS.fetch(parsed.format)
end

#output_contentString



23
24
25
# File 'lib/eac_cli/runner_with/output_item.rb', line 23

def output_content
  formatter.to_output
end