Sha256: 29af7cf15b33a6e90c9759299f2906e134be0fab820a68a8f3ec1cc322b601a3

Contents?: true

Size: 749 Bytes

Versions: 37

Compression:

Stored size: 749 Bytes

Contents

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

          def help
            super("The following are the available filters on people:")
          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

37 entries across 37 versions & 1 rubygems

Version Path
eco-helpers-2.0.25 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.24 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.23 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.22 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.21 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.19 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.18 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.17 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.16 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.15 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.14 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.13 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.12 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.11 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.10 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.9 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.8 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.7 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.6 lib/eco/cli/config/filters/people_filters.rb
eco-helpers-2.0.5 lib/eco/cli/config/filters/people_filters.rb