Module: Namecheap::DNS

Extended by:
DNS
Includes:
API
Included in:
DNS
Defined in:
lib/namecheap/resources/dns.rb

Constant Summary

Constants included from API

API::PRODUCTION, API::SANDBOX

Instance Method Summary collapse

Methods included from API

#get, #post

Instance Method Details

#get_email_forwarding(domain) ⇒ Object



5
6
7
# File 'lib/namecheap/resources/dns.rb', line 5

def get_email_forwarding(domain)
  get 'domains.dns.getEmailForwarding', DomainName: domain
end

#get_hosts(domain) ⇒ Object



9
10
11
# File 'lib/namecheap/resources/dns.rb', line 9

def get_hosts(domain)
  get 'domains.dns.getHosts', split_domain(domain)
end

#get_list(domain) ⇒ Object



13
14
15
# File 'lib/namecheap/resources/dns.rb', line 13

def get_list(domain)
  get 'domains.dns.getList', split_domain(domain)
end

#set_custom(domain, nameservers) ⇒ Object



17
18
19
20
21
# File 'lib/namecheap/resources/dns.rb', line 17

def set_custom(domain, nameservers)
  nameservers = nameservers.is_a?(Array) ? nameservers.join(',') : nameservers

  get 'domains.dns.setCustom', split_domain(domain).merge(Nameservers: nameservers)
end

#set_default(domain) ⇒ Object



23
24
25
# File 'lib/namecheap/resources/dns.rb', line 23

def set_default(domain)
  get 'domains.dns.setDefault', split_domain(domain)
end

#set_email_forwarding(domain, mailboxes) ⇒ Object



27
28
29
# File 'lib/namecheap/resources/dns.rb', line 27

def set_email_forwarding(domain, mailboxes)
  get 'domains.dns.setEmailForwarding', { DomainName: domain }.merge(format_mailboxes(mailboxes))
end

#set_hosts(domain, hosts) ⇒ Object



31
32
33
# File 'lib/namecheap/resources/dns.rb', line 31

def set_hosts(domain, hosts)
  get 'domains.dns.setHosts', split_domain(domain).merge(format_hosts(hosts))
end