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.
9 10 11 12 13 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 9 def initialize(resources, limit) @resources = initialize_resources(resources) validate_limit(limit) initialize_variables(limit) end |
Class Method Details
.limiter_parameters ⇒ Object
19 20 21 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 19 def self.limiter_parameters [] end |
Instance Method Details
#initialize_resources(resources) ⇒ Object (private)
27 28 29 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 27 def initialize_resources(resources) resources end |
#initialize_variables(limit) ⇒ Object (private)
25 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 25 def initialize_variables(limit); end |
#limit ⇒ Object
15 16 17 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 15 def limit raise NotImplementedError end |
#validate_limit(limit) ⇒ Object (private)
31 32 33 |
# File 'lib/gitlab/triage/limiters/base_limiter.rb', line 31 def validate_limit(limit) LimiterValidator.new(self.class.limiter_parameters, limit).validate! end |