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.45 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.44 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.43 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.42 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.41 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.40 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.39 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.38 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.37 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.36 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.35 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.34 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.33 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.32 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.31 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.30 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.29 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.28 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.27 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.26 lib/eco/cli/config/filters/people_filters.rb