Sha256: bf828724c404c2038871a22c7e7e8d45b6bb493fc5bb35834788960cf7a03230

Contents?: true

Size: 705 Bytes

Versions: 63

Compression:

Stored size: 705 Bytes

Contents

require 'active_support/all'

module Gitlab
  module Triage
    module Limiters
      class BaseLimiter
        def initialize(resources, limit)
          @resources = initialize_resources(resources)
          validate_limit(limit)
          initialize_variables(limit)
        end

        def limit
          raise NotImplementedError
        end

        def self.limiter_parameters
          []
        end

        private

        def initialize_variables(limit); end

        def initialize_resources(resources)
          resources
        end

        def validate_limit(limit)
          LimiterValidator.new(self.class.limiter_parameters, limit).validate!
        end
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 2 rubygems

Version Path
gitlab-triage-1.19.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.18.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.17.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.16.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.15.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.14.3 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.14.2 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.14.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.14.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.13.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.12.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.11.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.10.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.10.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.9.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.8.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.7.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.7.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.6.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.6.0 lib/gitlab/triage/limiters/base_limiter.rb