Class: Eco::CLI::Config::Filters::InputFilters
Instance Attribute Summary
#core_config
Instance Method Summary
collapse
#add, #available, #initialize
Instance Method Details
#help(refine: nil) ⇒ Object
7
8
9
10
|
# File 'lib/eco/cli/config/filters/input_filters.rb', line 7
def help(refine: nil)
refinement = refine.is_a?(String)? " (containing: '#{refine}')" : ""
super("The following are the available filters on the input entries#{refinement}:", refine: refine)
end
|
#process(io:) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/eco/cli/config/filters/input_filters.rb', line 12
def process(io:)
unless io && io.is_a?(Eco::API::UseCases::BaseIO)
raise "You need to provide Eco::API::UseCases::BaseIO object. Given: #{io.class}"
end
io = io.new(type: :import)
@filters.each do |arg, callback|
if SCR.get_arg(arg)
io = io.new(input: callback.call(*io.params))
end
end
io.input
end
|