def ready_for_challenge(domain, dns_challenge)
      record = "#{dns_challenge.record_name}.#{domain}"
      challenge_value = dns_challenge.record_content
      txt_value = Resolv::DNS.open do |dns|
        records = dns.getresources(record, Resolv::DNS::Resource::IN::TXT);
        records.empty? ? nil : records.map(&:data).join(" ")
      end
      txt_value == challenge_value
    end
def ready_for_challenge(domain, dns_challenge)
      record = "#{dns_challenge.record_name}.#{domain}"
      challenge_value = dns_challenge.record_content
      txt_value = Resolv::DNS.open do |dns|
        records = dns.getresources(record, Resolv::DNS::Resource::IN::TXT);
        records.empty? ? nil : records.map(&:data).join(" ")
      end
      txt_value == challenge_value
    end
Check if TXT value has been set correctly