Class: Gitlab::Triage::Limiters::BaseLimiter
- Inherits:
-
Object
- Object
- Gitlab::Triage::Limiters::BaseLimiter
- Defined in:
- lib/gitlab/triage/limiters/base_limiter.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(resources, limit) ⇒ BaseLimiter
constructor
A new instance of BaseLimiter.
- #initialize_resources(resources) ⇒ Object private
- #initialize_variables(limit) ⇒ Object private
- #limit ⇒ Object
- #validate_limit(limit) ⇒ Object private
Constructor Details
#initialize(resources, limit) ⇒ BaseLimiter
Returns a new instance of BaseLimiter.
7 8 9 10 11 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 7 def initialize(resources, limit) @resources = initialize_resources(resources) validate_limit(limit) initialize_variables(limit) end |
Class Method Details
.limiter_parameters ⇒ Object
17 18 19 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 17 def self.limiter_parameters [] end |
Instance Method Details
#initialize_resources(resources) ⇒ Object (private)
25 26 27 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 25 def initialize_resources(resources) resources end |
#initialize_variables(limit) ⇒ Object (private)
23 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 23 def initialize_variables(limit); end |
#limit ⇒ Object
13 14 15 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 13 def limit raise NotImplementedError end |
#validate_limit(limit) ⇒ Object (private)
29 30 31 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 29 def validate_limit(limit) LimiterValidator.new(self.class.limiter_parameters, limit).validate! end |