Method: Backup::Notifier::Mail#perform!

Defined in:
lib/backup/notifier/mail.rb

#perform!(model, exception = false) ⇒ Object

Performs the notification Takes an exception object that might’ve been created if an exception occurred. If this is the case it’ll invoke notify_failure!(exception), otherwise, if no error was raised, it’ll go ahead and notify_success!

If’ll only perform these if on_success is true or on_failure is true



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/backup/notifier/mail.rb', line 76

def perform!(model, exception = false)
  @model = model

  if notify_on_success? and exception.eql?(false)
    log!
    notify_success!
  elsif notify_on_failure? and not exception.eql?(false)
    log!
    notify_failure!(exception)
  end
end