module Namecheap::Domain

Public Instance Methods

check(domains) click to toggle source
# File lib/namecheap/resources/domain.rb, line 5
def check(domains)
  domains = domains.is_a?(Array) ? domains.join(',') : domains

  get 'domains.check', DomainList: domains
end
create(*) click to toggle source
# File lib/namecheap/resources/domain.rb, line 11
def create(*)
  raise 'implementation needed'
end
get_contacts(domain) click to toggle source
# File lib/namecheap/resources/domain.rb, line 15
def get_contacts(domain)
  get 'domains.getContacts', DomainName: domain
end
get_info(domain) click to toggle source
# File lib/namecheap/resources/domain.rb, line 19
def get_info(domain)
  get 'domains.getInfo', DomainName: domain
end
get_list() click to toggle source
# File lib/namecheap/resources/domain.rb, line 23
def get_list
  get 'domains.getList'
end
get_registrar_lock(domain) click to toggle source
# File lib/namecheap/resources/domain.rb, line 27
def get_registrar_lock(domain)
  get 'domains.getRegistrarLock', DomainName: domain
end
get_tld_list() click to toggle source
# File lib/namecheap/resources/domain.rb, line 31
def get_tld_list
  get 'domains.getTldList'
end
reactivate(domain) click to toggle source
# File lib/namecheap/resources/domain.rb, line 35
def reactivate(domain)
  get 'domains.reactivate', DomainName: domain
end
renew(domain, years = 1, promo_code = nil) click to toggle source
# File lib/namecheap/resources/domain.rb, line 39
def renew(domain, years = 1, promo_code = nil)
  params = { DomainName: domain, Years: years }
  params.merge!(PromotionCode: promo_code) unless promo_code.nil?

  get 'domains.renew', params
end
set_contacts(*) click to toggle source
# File lib/namecheap/resources/domain.rb, line 46
def set_contacts(*)
  raise 'implementation needed'
end
set_registrar_lock(domain, lock) click to toggle source
# File lib/namecheap/resources/domain.rb, line 50
def set_registrar_lock(domain, lock)
  raise "Lock value must be 'LOCK' or 'UNLOCK'" unless lock == 'LOCK' || lock == 'UNLOCK'

  params = { DomainName: domain, LockAction: lock }

  get 'domains.setRegistrarLock', params
end