14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/internetbs/private_whois.rb', line 14
def fetch
ensure_attribute_has_value :domain
return false if @errors.any?
params = {'domain' => @domain}
response = Client.get('/domain/privatewhois/status', params)
code = response.code rescue ""
case code
when '200'
hash = JSON.parse(response.body)
@status = hash['status']
@transaction_id = hash['transactid']
if @status == 'SUCCESS'
@privacy_status = hash['privatewhoisstatus']
else
set_errors(response)
return false
end
return true
else
set_errors(response)
return false
end
end
|