Class: Resque::Integration::Configuration::Notifier

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/resque/integration/configuration.rb

Overview

Failure notifier configuration

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Notifier

Returns a new instance of Notifier.



47
48
49
# File 'lib/resque/integration/configuration.rb', line 47

def initialize(config)
  super(config || {})
end

Instance Method Details

#enabled?Boolean

Is notifier enabled

Returns:

  • (Boolean)


52
53
54
# File 'lib/resque/integration/configuration.rb', line 52

def enabled?
  to.any? && enabled.nil? ? true : enabled
end

#fromObject

Returns sender address



69
70
71
# File 'lib/resque/integration/configuration.rb', line 69

def from
  super || '[email protected]'
end

#include_payload?Boolean

Returns true if payload should be included into reports

Returns:

  • (Boolean)


57
58
59
60
61
# File 'lib/resque/integration/configuration.rb', line 57

def include_payload?
  include_payload.nil? ?
    true :
    include_payload
end

#mailObject

Returns mailer method



74
75
76
# File 'lib/resque/integration/configuration.rb', line 74

def mail
  (super || :alert).to_sym
end

#mailerObject

Returns mailer class



79
80
81
# File 'lib/resque/integration/configuration.rb', line 79

def mailer
  super || 'ResqueFailedJobMailer::Mailer'
end

#toObject

Returns recipients list



64
65
66
# File 'lib/resque/integration/configuration.rb', line 64

def to
  super || []
end