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.42.2 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.42.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.42.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.41.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.40.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.30.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.29.0 lib/gitlab/triage/limiters/base_limiter.rb
payping-gitlab-triage-0.1.3 lib/gitlab/triage/limiters/base_limiter.rb
payping-gitlab-triage-0.1.2 lib/gitlab/triage/limiters/base_limiter.rb
payping-gitlab-triage-0.1.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.28.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.27.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.26.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.25.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.24.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.23.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.23.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.22.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.21.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.20.0 lib/gitlab/triage/limiters/base_limiter.rb