Module: Eco::API::UseCases::Lib::Files::InputFile

Defined in:
lib/eco/api/usecases/lib/files/input_file.rb

Overview

Note:

Assumes that, if Cli invoked, there could be Cli options defined

Note:

it includes and extends FilePattern:

  • file_pattern_from_const would prioritize constants as accepted in INPUT_FILENAME_CONSTS
  • file_pattern_const_from_options would prioritize :input :file :pattern

under :input :file:

- `:name`
- `:format` (overriding `INPUT_FORMAT` const)
- `:encoding`
- `:pattern` (target pattern const)

Defined Under Namespace

Modules: InstanceMethods

Constant Summary collapse

INPUT_FILENAME_CONSTS =
%i[
  INPUT_FILENAME IN_FILENAME INPUT_FILE_PATTERN IN_FILE_PATTERN
].freeze

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/eco/api/usecases/lib/files/input_file.rb', line 18

def included(base)
  super

  base.send :include, Eco::API::UseCases::Lib::Base::Env unless base.include?(Eco::API::UseCases::Lib::Base::Env)
  base.send :extend, Eco::Data::Files::Folder
  base.send :include, Eco::API::UseCases::Lib::Files::FilePattern
  base.send :include, InstanceMethods
end