Class: Eco::CliDefault::Input
- Inherits:
-
API::Common::Loaders::CliConfig
- Object
- API::Common::Loaders::Config
- API::Common::Loaders::CliConfig
- Eco::CliDefault::Input
- Defined in:
- lib/eco/cli_default/input.rb
Constant Summary collapse
- FORMATS =
{ csv: { option: ["-csv"], extname: [".csv", ".txt"] }, xml: { option: ["-xml"], extname: [".xml"] }, xls: { option: ["-xls", "-xlsx", "-excel"], extname: [".xls", ".xlsx", ".xlsm"] }, json: { option: ["-json"], extname: [".json"] } }.freeze
Class Attribute Summary collapse
-
.options ⇒ Object
readonly
Returns the value of attribute options.
-
.session ⇒ Object
readonly
Returns the value of attribute session.
Class Method Summary collapse
Methods inherited from API::Common::Loaders::CliConfig
Methods inherited from API::Common::Loaders::Config
active_enviro, cli, config, config_block
Methods included from API::Common::ClassHelpers
#class_resolver, #descendants, #descendants?, #inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant
Methods included from Language::Methods::DelegateMissing
#delegate_missing_to, #method_missing, #respond_to_missing?
Class Attribute Details
.options ⇒ Object (readonly)
Returns the value of attribute options.
22 23 24 |
# File 'lib/eco/cli_default/input.rb', line 22 def @options end |
.session ⇒ Object (readonly)
Returns the value of attribute session.
22 23 24 |
# File 'lib/eco/cli_default/input.rb', line 22 def session @session end |
Class Method Details
.encoding ⇒ Object
24 25 26 |
# File 'lib/eco/cli_default/input.rb', line 24 def encoding .dig(:input, :file, :encoding) end |
.format_by_cli ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/eco/cli_default/input.rb', line 28 def format_by_cli FORMATS.reduce(nil) do |matched, (frm, selectors)| next matched if matched used = selectors[:option].reduce(false) do |us, option| SCR.get_arg(option) || us end next frm if used end end |