Class: SupplejackApi::InteractionMetricsWorker

Inherits:
Object
  • Object
show all
Defined in:
app/workers/supplejack_api/interaction_metrics_worker.rb

Defined Under Namespace

Classes: InteractionUpdater

Class Method Summary collapse

Class Method Details

.performObject



16
17
18
19
20
21
# File 'app/workers/supplejack_api/interaction_metrics_worker.rb', line 16

def self.perform
  @interaction_updaters.each do |interaction_updater|
    models_to_process = interaction_updater.model.all
    models_to_process.delete_all if interaction_updater.process(models_to_process.to_a)
  end
end

.register_interaction_updater(interaction_updater) ⇒ Object



23
24
25
# File 'app/workers/supplejack_api/interaction_metrics_worker.rb', line 23

def self.register_interaction_updater(interaction_updater)
  @interaction_updaters << interaction_updater.new
end