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
28
29
30
|
# File 'lib/eac_cli/runner_with/output_item.rb', line 28
def formatter
formatter_class.new(item_hash)
end
|
33
34
35
|
# File 'lib/eac_cli/runner_with/output_item.rb', line 33
def formatter_class
FORMATS.fetch(parsed.format)
end
|
#output_content ⇒ String
23
24
25
|
# File 'lib/eac_cli/runner_with/output_item.rb', line 23
def output_content
formatter.to_output
end
|