class Qmin::Reporting::Mail

Public Class Methods

delivery_method() click to toggle source
# File lib/qmin/reporting/mail.rb, line 14
def delivery_method
  @delivery_method
end
delivery_options() click to toggle source
# File lib/qmin/reporting/mail.rb, line 18
def delivery_options
  @delivery_options
end
mail_from() click to toggle source
# File lib/qmin/reporting/mail.rb, line 31
def mail_from
  @mail_from
end
mail_to() click to toggle source
# File lib/qmin/reporting/mail.rb, line 27
def mail_to
  @mail_to
end
setup_delivery(delivery_method, delivery_options = {}) click to toggle source
# File lib/qmin/reporting/mail.rb, line 9
def setup_delivery(delivery_method, delivery_options = {})
  @delivery_method  = delivery_method
  @delivery_options = delivery_options
end
setup_mail(to, from) click to toggle source
# File lib/qmin/reporting/mail.rb, line 22
def setup_mail(to, from)
  @mail_to    = to
  @mail_from  = from
end

Public Instance Methods

report(exception) click to toggle source
# File lib/qmin/reporting/mail.rb, line 36
def report(exception)
  deliver(mail(exception))
end

Private Instance Methods

deliver(mail) click to toggle source
# File lib/qmin/reporting/mail.rb, line 46
def deliver(mail)
  if self.class.delivery_method && self.class.delivery_options
    mail.delivery_method(self.class.delivery_method, self.class.delivery_options)
  end

  mail.deliver
end
mail(exception) click to toggle source
# File lib/qmin/reporting/mail.rb, line 42
def mail(exception)
  MailBuilder.new(exception, self.class.mail_to, self.class.mail_from).build
end