Sha256: b9fcd1c57069c22c00d4c58b591e7381d2127ad8e0ba20e7b534df191a08cf1b

Contents?: true

Size: 873 Bytes

Versions: 80

Compression:

Stored size: 873 Bytes

Contents

module Eco
  class CLI
    class Config
      class Filters
        class PeopleFilters < Eco::CLI::Config::Filters

          def help(refine: nil)
            refinement = refine.is_a?(String)? " (containing: '#{refine}')" : ""
            super("The following are the available filters on people#{refinement}:", refine: refine)
          end

          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: :transform)
            @filters.each do |arg, callback|
              if SCR.get_arg(arg)
                io = io.new(people: callback.call(*io.params))
              end
            end
            io.people
          end

        end
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
eco-helpers-2.0.65 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.64 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.63 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.62 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.61 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.60 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.59 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.58 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.57 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.56 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.55 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.54 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.53 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.52 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.51 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.50 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.49 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.48 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.47 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.46 lib/eco/cli/config/filters/people_filters.rb