Class: Namecheap::Dns

Inherits:
Api
  • Object
show all
Defined in:
lib/namecheap/dns.rb

Constant Summary

Constants inherited from Api

Api::ENDPOINT, Api::ENVIRONMENT, Api::PRODUCTION, Api::SANDBOX

Instance Method Summary collapse

Methods inherited from Api

#api_call, #init_args

Instance Method Details

#get_email_forwarding(domain, options = {}) ⇒ Object



32
33
34
35
36
# File 'lib/namecheap/dns.rb', line 32

def get_email_forwarding(domain, options = {})
  args = options.clone
  args['DomainName'] = domain
  api_call('namecheap.domains.dns.getEmailForwarding', args)
end

#get_hosts(sld, tld, options = {}) ⇒ Object



25
26
27
28
29
30
# File 'lib/namecheap/dns.rb', line 25

def get_hosts(sld, tld, options = {})
  args = options.clone
  args['SLD'] = sld
  args['TLD'] = tld
  api_call('namecheap.domains.dns.getHosts', args)
end

#get_list(sld, tld, options = {}) ⇒ Object



18
19
20
21
22
23
# File 'lib/namecheap/dns.rb', line 18

def get_list(sld, tld, options = {})
  args = options.clone
  args['SLD'] = sld
  args['TLD'] = tld
  api_call('namecheap.domains.dns.getList', args)
end

#set_custom(sld, tld, nameservers = [], options = {}) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/namecheap/dns.rb', line 10

def set_custom(sld, tld, nameservers = [], options = {})
  args = options.clone
  args['SLD'] = sld
  args['TLD'] = tld
  args['Nameservers'] = nameservers.respond_to?(:join) ? nameservers.join(',') : nameservers
  api_call('namecheap.domains.dns.setCustom', args)
end

#set_default(sld, tld, options = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/namecheap/dns.rb', line 3

def set_default(sld, tld, options = {})
  args = options.clone
  args['SLD'] = sld
  args['TLD'] = tld
  api_call('namecheap.domains.dns.setDefault', args)
end

#set_email_forwarding(domain, options = {}) ⇒ Object



38
39
40
41
42
# File 'lib/namecheap/dns.rb', line 38

def set_email_forwarding(domain, options = {})
  args = options.clone
  args['DomainName'] = domain
  api_call('namecheap.domains.dns.setEmailForwarding', args)
end

#set_hosts(sld, tld, options = {}) ⇒ Object



44
45
46
47
48
49
# File 'lib/namecheap/dns.rb', line 44

def set_hosts(sld, tld, options = {})
  args = options.clone
  args['SLD'] = sld
  args['TLD'] = tld
  api_call('namecheap.domains.dns.setHosts', args)
end