Class: Seer::DNS
- Inherits:
-
Object
- Object
- Seer::DNS
- Defined in:
- lib/seer/dns.rb
Overview
DNS API controller
Instance Method Summary collapse
-
#domain(domain) ⇒ Hash
Get ip from domain.
-
#initialize(token: '', version: '2.0', host: '') ⇒ DNS
constructor
Initialize a DNS object.
-
#ip(ip) ⇒ Hash
Get domain by ip.
-
#search(type, key) ⇒ Hash
Advance search.
-
#subdomain(subdomain) ⇒ Hash
Get sub domain from domain.
Constructor Details
#initialize(token: '', version: '2.0', host: '') ⇒ DNS
Initialize a DNS object
8 9 10 11 12 13 14 15 |
# File 'lib/seer/dns.rb', line 8 def initialize(token: '', version: '2.0', host: '') @host = host + '/dns' @header = { content_type: 'application/json', x_seer_token: token, x_seer_version: version } end |
Instance Method Details
#domain(domain) ⇒ Hash
Get ip from domain
20 21 22 23 24 |
# File 'lib/seer/dns.rb', line 20 def domain(domain) body = { domain: domain } url = @host + '/domain' Seer.request(url, body, @header) end |
#ip(ip) ⇒ Hash
Get domain by ip
38 39 40 41 42 |
# File 'lib/seer/dns.rb', line 38 def ip(ip) body = { ip: ip } url = @host + '/ip' Seer.request(url, body, @header) end |