Class: StatusCat::Checkers::ActionMailer
- Inherits:
-
Base
- Object
- Base
- StatusCat::Checkers::ActionMailer
show all
- Defined in:
- lib/status_cat/checkers/action_mailer.rb
Constant Summary
Constants inherited
from Base
Base::FORMAT
Instance Attribute Summary
Attributes inherited from Base
#status, #value
Instance Method Summary
collapse
Methods inherited from Base
class_to_name, #name, #to_s
Constructor Details
Returns a new instance of ActionMailer.
5
6
7
8
9
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 5
def initialize
@value = "#{address}:#{port}"
return if ::ActionMailer::Base.delivery_method == :test
@status = fail_on_exception { test }
end
|
Instance Method Details
#address ⇒ Object
22
23
24
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 22
def address
return config[:address]
end
|
#authentication ⇒ Object
26
27
28
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 26
def authentication
return config[:authentication]
end
|
#config ⇒ Object
18
19
20
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 18
def config
@config ||= ::ActionMailer::Base.smtp_settings
end
|
#domain ⇒ Object
30
31
32
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 30
def domain
return config[:domain]
end
|
#password ⇒ Object
34
35
36
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 34
def password
return config[:password]
end
|
#port ⇒ Object
38
39
40
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 38
def port
return config[:port]
end
|
#test ⇒ Object
11
12
13
14
15
16
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 11
def test
Net::SMTP.start(address, port, domain, user_name, password, authentication) do |smtp|
smtp.helo(domain)
end
return nil
end
|
#user_name ⇒ Object
42
43
44
|
# File 'lib/status_cat/checkers/action_mailer.rb', line 42
def user_name
return config[:user_name]
end
|