Class: SidekiqTamer::Resource::Vault
- Inherits:
-
Object
- Object
- SidekiqTamer::Resource::Vault
- Defined in:
- lib/sidekiq_tamer/resource/vault.rb
Class Method Summary collapse
- .add_resources(*resources) ⇒ Object
- .clean_resources ⇒ Object
- .get_resources ⇒ Object
- .get_resources_for(job) ⇒ Object
- .get_resources_of_type(klass) ⇒ Object
- .resources ⇒ Object
Class Method Details
.add_resources(*resources) ⇒ Object
19 20 21 |
# File 'lib/sidekiq_tamer/resource/vault.rb', line 19 def self.add_resources(*resources) self.resources.push(*resources) end |
.clean_resources ⇒ Object
15 16 17 |
# File 'lib/sidekiq_tamer/resource/vault.rb', line 15 def self.clean_resources @resources = [] end |
.get_resources ⇒ Object
3 4 5 |
# File 'lib/sidekiq_tamer/resource/vault.rb', line 3 def self.get_resources resources end |
.get_resources_for(job) ⇒ Object
23 24 25 |
# File 'lib/sidekiq_tamer/resource/vault.rb', line 23 def self.get_resources_for(job) get_resources.select { |resource| resource.is_consumed_by?(job) } end |
.get_resources_of_type(klass) ⇒ Object
7 8 9 |
# File 'lib/sidekiq_tamer/resource/vault.rb', line 7 def self.get_resources_of_type(klass) resources.select { |resource| resource.is_a?(klass) } end |
.resources ⇒ Object
11 12 13 |
# File 'lib/sidekiq_tamer/resource/vault.rb', line 11 def self.resources @resources ||= [] end |