Class: SidekiqTamer::Resource::Vault

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_tamer/resource/vault.rb

Class Method Summary collapse

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_resourcesObject



15
16
17
# File 'lib/sidekiq_tamer/resource/vault.rb', line 15

def self.clean_resources
  @resources = []
end

.get_resourcesObject



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

.resourcesObject



11
12
13
# File 'lib/sidekiq_tamer/resource/vault.rb', line 11

def self.resources
  @resources ||= []
end