Class: RailsLiveDashboard::Recorders::Jobs::PerformRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_live_dashboard/recorders/jobs/perform_recorder.rb

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ PerformRecorder

Returns a new instance of PerformRecorder.



5
6
7
8
# File 'lib/rails_live_dashboard/recorders/jobs/perform_recorder.rb', line 5

def initialize(event)
  @event = event
  @job = Job.same(@event.payload[:job].job_id).first
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
# File 'lib/rails_live_dashboard/recorders/jobs/perform_recorder.rb', line 10

def execute
  raise Exceptions::EntryNotFound.new(:job, @event.payload[:job].job_id) if @job.nil?

  build_content
  build_history

  @job.update(content:)
end