Class: OkComputer::ActionMailerCheck
- Defined in:
- lib/ok_computer/built_in_checks/action_mailer_check.rb
Overview
Verifies if the mail server configured for ActionMailer is responding.
Constant Summary
Constants inherited from PingCheck
Constants inherited from Check
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#port ⇒ Object
Returns the value of attribute port.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Attributes inherited from PingCheck
Attributes inherited from Check
#failure_occurred, #message, #registrant_name, #time
Instance Method Summary collapse
-
#check ⇒ Object
Public: Return the status of the check.
-
#initialize(klass = ActionMailer::Base, timeout = 5) ⇒ ActionMailerCheck
constructor
A new instance of ActionMailerCheck.
Methods inherited from Check
#<=>, #clear, #mark_failure, #mark_message, #run, #success?, #to_json, #to_text, #with_benchmarking
Constructor Details
#initialize(klass = ActionMailer::Base, timeout = 5) ⇒ ActionMailerCheck
Returns a new instance of ActionMailerCheck.
7 8 9 10 11 12 13 |
# File 'lib/ok_computer/built_in_checks/action_mailer_check.rb', line 7 def initialize(klass = ActionMailer::Base, timeout = 5) self.klass = klass self.timeout = timeout host = klass.smtp_settings[:address] port = klass.smtp_settings[:port] || 25 super(host, port, timeout) end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/ok_computer/built_in_checks/action_mailer_check.rb', line 5 def host @host end |
#klass ⇒ Object
Returns the value of attribute klass.
5 6 7 |
# File 'lib/ok_computer/built_in_checks/action_mailer_check.rb', line 5 def klass @klass end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/ok_computer/built_in_checks/action_mailer_check.rb', line 5 def port @port end |
#timeout ⇒ Object
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/ok_computer/built_in_checks/action_mailer_check.rb', line 5 def timeout @timeout end |
Instance Method Details
#check ⇒ Object
Public: Return the status of the check
16 17 18 19 20 21 22 |
# File 'lib/ok_computer/built_in_checks/action_mailer_check.rb', line 16 def check tcp_socket_request "#{klass} check to #{host}:#{port} successful" rescue => e "#{klass} at #{host}:#{port} is not accepting connections: '#{e}'" mark_failure end |