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.5.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.5.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.4.2 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.4.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.4.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.3.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.2.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.1.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.1.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.0.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-1.0.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.17.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.16.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.15.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.14.1 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.14.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.13.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.12.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.11.0 lib/gitlab/triage/limiters/base_limiter.rb
gitlab-triage-0.10.0 lib/gitlab/triage/limiters/base_limiter.rb