Class: DoHClient::Client::Cloudflare

Inherits:
Base
  • Object
show all
Defined in:
lib/doh_client/client/cloudflare.rb

Instance Method Summary collapse

Methods inherited from Base

#resolve, resolve

Instance Method Details

#build_query(name, options) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/doh_client/client/cloudflare.rb', line 10

def build_query(name, options)
  {
    name: name,
    type: options[:type],
    cd: options[:cd],
    do: options[:do]
  }.compact
end

#endpointObject



6
7
8
# File 'lib/doh_client/client/cloudflare.rb', line 6

def endpoint
  "https://cloudflare-dns.com/dns-query"
end

#validate(query) ⇒ Object

Raises:

  • (ArgumentError)


19
20
21
22
# File 'lib/doh_client/client/cloudflare.rb', line 19

def validate(query)
  super(query)
  raise ArgumentError, "do must be a boolean value" if query[:do] && !boolean?(query[:do])
end