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,
lib/eac_cli/runner_with/output_item/asciidoc_formatter.rb
Defined Under Namespace
Classes: AsciidocFormatter, BaseFormatter, CsvFormatter, YamlFormatter
Constant Summary
collapse
- FORMATS =
%w[asciidoc csv yaml].freeze
Instance Method Summary
collapse
Instance Method Details
35
36
37
38
39
|
# File 'lib/eac_cli/runner_with/output_item.rb', line 35
def formats
FORMATS.to_h do |e|
[e, ::EacCli::RunnerWith::OutputItem.const_get("#{e.camelize}Formatter")]
end
end
|
25
26
27
|
# File 'lib/eac_cli/runner_with/output_item.rb', line 25
def formatter
formatter_class.new(item_hash)
end
|
30
31
32
|
# File 'lib/eac_cli/runner_with/output_item.rb', line 30
def formatter_class
formats.fetch(parsed.format)
end
|
Returns Hash<String, Enumerable<String>].
42
43
44
|
# File 'lib/eac_cli/runner_with/output_item.rb', line 42
def
help_list_section('Formats', formats.keys.sort)
end
|
#output_content ⇒ String
20
21
22
|
# File 'lib/eac_cli/runner_with/output_item.rb', line 20
def output_content
formatter.to_output
end
|