Module: Namecheap::Domain
- Extended by:
- Domain
- Includes:
- API
- Included in:
- Domain
- Defined in:
- lib/namecheap/resources/domain.rb
Constant Summary
Constants included
from API
API::PRODUCTION, API::SANDBOX
Instance Method Summary
collapse
Methods included from API
#get, #post
Instance Method Details
#check(domains) ⇒ Object
5
6
7
8
9
|
# 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 ⇒ Object
11
12
13
|
# File 'lib/namecheap/resources/domain.rb', line 11
def create(*)
raise 'implementation needed'
end
|
15
16
17
|
# File 'lib/namecheap/resources/domain.rb', line 15
def get_contacts(domain)
get 'domains.getContacts', DomainName: domain
end
|
#get_info(domain) ⇒ Object
19
20
21
|
# File 'lib/namecheap/resources/domain.rb', line 19
def get_info(domain)
get 'domains.getInfo', DomainName: domain
end
|
#get_list ⇒ Object
23
24
25
|
# File 'lib/namecheap/resources/domain.rb', line 23
def get_list
get 'domains.getList'
end
|
#get_registrar_lock(domain) ⇒ Object
27
28
29
|
# File 'lib/namecheap/resources/domain.rb', line 27
def get_registrar_lock(domain)
get 'domains.getRegistrarLock', DomainName: domain
end
|
#get_tld_list ⇒ Object
31
32
33
|
# File 'lib/namecheap/resources/domain.rb', line 31
def get_tld_list
get 'domains.getTldList'
end
|
#reactivate(domain) ⇒ Object
35
36
37
|
# File 'lib/namecheap/resources/domain.rb', line 35
def reactivate(domain)
get 'domains.reactivate', DomainName: domain
end
|
#renew(domain, years = 1, promo_code = nil) ⇒ Object
39
40
41
42
43
44
|
# 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
|
46
47
48
|
# File 'lib/namecheap/resources/domain.rb', line 46
def set_contacts(*)
raise 'implementation needed'
end
|
#set_registrar_lock(domain, lock) ⇒ Object
50
51
52
53
54
55
56
|
# 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
|