Class: Kuroko2::Workflow::Notifier::Mail

Inherits:
Object
  • Object
show all
Defined in:
lib/autoload/kuroko2/workflow/notifier/mail.rb

Instance Method Summary collapse

Constructor Details

#initialize(job_instance) ⇒ Mail

Returns a new instance of Mail.



5
6
7
8
# File 'lib/autoload/kuroko2/workflow/notifier/mail.rb', line 5

def initialize(job_instance)
  @job_instance = job_instance
  @definition   = job_instance.job_definition
end

Instance Method Details

#notify_cancellationObject



14
15
16
17
18
# File 'lib/autoload/kuroko2/workflow/notifier/mail.rb', line 14

def notify_cancellation
  if @definition.notify_cancellation
    deliver_job_failure
  end
end

#notify_criticalObject



24
25
26
# File 'lib/autoload/kuroko2/workflow/notifier/mail.rb', line 24

def notify_critical
  deliver_job_failure
end

#notify_failureObject



20
21
22
# File 'lib/autoload/kuroko2/workflow/notifier/mail.rb', line 20

def notify_failure
  deliver_job_failure
end

#notify_finishedObject



28
29
30
# File 'lib/autoload/kuroko2/workflow/notifier/mail.rb', line 28

def notify_finished
  # do nothing
end

#notify_long_elapsed_timeObject



32
33
34
# File 'lib/autoload/kuroko2/workflow/notifier/mail.rb', line 32

def notify_long_elapsed_time
  Kuroko2::Notifications.notify_long_elapsed_time(@job_instance).deliver_now
end

#notify_workingObject



10
11
12
# File 'lib/autoload/kuroko2/workflow/notifier/mail.rb', line 10

def notify_working
  # do nothing
end