Class: Gitlab::Ci::Limit

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/limit.rb

Overview

Abstract base class for CI/CD Quotas

Direct Known Subclasses

Pipeline::Quota::Deployments

Constant Summary collapse

LimitExceededError =
Class.new(StandardError)

Instance Method Summary collapse

Constructor Details

#initialize(_context, _resource) ⇒ Limit

Returns a new instance of Limit.


11
12
# File 'lib/gitlab/ci/limit.rb', line 11

def initialize(_context, _resource)
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

14
15
16
# File 'lib/gitlab/ci/limit.rb', line 14

def enabled?
  raise NotImplementedError
end

#exceeded?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

18
19
20
# File 'lib/gitlab/ci/limit.rb', line 18

def exceeded?
  raise NotImplementedError
end

#log_error!(extra_context = {}) ⇒ Object


26
27
28
# File 'lib/gitlab/ci/limit.rb', line 26

def log_error!(extra_context = {})
  ::Gitlab::ErrorTracking.log_exception(limit_exceeded_error, extra_context)
end

#messageObject

Raises:

  • (NotImplementedError)

22
23
24
# File 'lib/gitlab/ci/limit.rb', line 22

def message
  raise NotImplementedError
end