Sha256: d4ab61e4388eac1a45e77395c9d77507861351e3bd876f7907349d3e48dcb9c1

Contents?: true

Size: 521 Bytes

Versions: 27

Compression:

Stored size: 521 Bytes

Contents

require_relative 'params_validator'

module Gitlab
  module Triage
    class LimiterValidator < ParamsValidator
      private

      def params_limiter_names
        @parameter_definitions.map do |param|
          param[:name]
        end
      end

      def validate_required_parameters(value)
        raise ArgumentError, "For the limits field, please specify one of: `#{params_limiter_names.join('`, `')}`" unless value.keys.map(&:to_sym).one? { |key| params_limiter_names.include?(key) }
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
gitlab-triage-1.7.1 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.7.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.6.1 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.6.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.5.1 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.5.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.4.2 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.4.1 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.4.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.3.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.2.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.1.1 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.1.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.0.1 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-1.0.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-0.17.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-0.16.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-0.15.0 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-0.14.1 lib/gitlab/triage/validators/limiter_validator.rb
gitlab-triage-0.14.0 lib/gitlab/triage/validators/limiter_validator.rb