Class: Cloudflare::Email::Doctor
- Inherits:
-
Object
- Object
- Cloudflare::Email::Doctor
- Defined in:
- lib/cloudflare/email/doctor.rb
Overview
Diagnostic runner for ‘bin/rails cloudflare:email:doctor`. Verifies each layer of configuration independently so a new user can see exactly which piece is misconfigured.
Constant Summary collapse
- OK =
:ok- WARN =
:warn- FAIL =
:fail- SKIP =
:skip
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(io: $stdout) ⇒ Doctor
constructor
A new instance of Doctor.
Constructor Details
#initialize(io: $stdout) ⇒ Doctor
Returns a new instance of Doctor.
19 20 21 22 |
# File 'lib/cloudflare/email/doctor.rb', line 19 def initialize(io: $stdout) @io = io @results = [] end |
Class Method Details
.call(io: $stdout) ⇒ Object
15 16 17 |
# File 'lib/cloudflare/email/doctor.rb', line 15 def self.call(io: $stdout) new(io: io).call end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cloudflare/email/doctor.rb', line 24 def call header check_rails_loaded check_credentials check_api_token check_account_access check_sending_domains check_ingress_secret check_token_split check_action_mailbox_ingress check_delivery_method_registered summary @results.any? { |r| r[:status] == FAIL } ? 1 : 0 end |