Class: GitHubPages::HealthCheck::CAA
- Inherits:
-
Object
- Object
- GitHubPages::HealthCheck::CAA
- Defined in:
- lib/github-pages-health-check/caa.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#nameservers ⇒ Object
readonly
Returns the value of attribute nameservers.
Instance Method Summary collapse
- #errored? ⇒ Boolean
-
#initialize(host:, nameservers: :default) ⇒ CAA
constructor
A new instance of CAA.
- #lets_encrypt_allowed? ⇒ Boolean
- #records ⇒ Object
- #records_present? ⇒ Boolean
Constructor Details
#initialize(host:, nameservers: :default) ⇒ CAA
Returns a new instance of CAA.
12 13 14 15 16 17 |
# File 'lib/github-pages-health-check/caa.rb', line 12 def initialize(host:, nameservers: :default) raise ArgumentError, "host cannot be nil" if host.nil? @host = host @nameservers = nameservers end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
10 11 12 |
# File 'lib/github-pages-health-check/caa.rb', line 10 def error @error end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
10 11 12 |
# File 'lib/github-pages-health-check/caa.rb', line 10 def host @host end |
#nameservers ⇒ Object (readonly)
Returns the value of attribute nameservers.
10 11 12 |
# File 'lib/github-pages-health-check/caa.rb', line 10 def nameservers @nameservers end |
Instance Method Details
#errored? ⇒ Boolean
19 20 21 22 |
# File 'lib/github-pages-health-check/caa.rb', line 19 def errored? records # load the records first !error.nil? end |
#lets_encrypt_allowed? ⇒ Boolean
24 25 26 27 28 29 |
# File 'lib/github-pages-health-check/caa.rb', line 24 def lets_encrypt_allowed? return false if errored? return true unless records_present? records.any? { |r| r.property_value == "letsencrypt.org" } end |
#records ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/github-pages-health-check/caa.rb', line 37 def records return @records if defined?(@records) @records = get_caa_records(host) @records = get_caa_records(parent_host) if @records.nil? || @records.empty? @records end |
#records_present? ⇒ Boolean
31 32 33 34 35 |
# File 'lib/github-pages-health-check/caa.rb', line 31 def records_present? return false if errored? records && !records.empty? end |