whoisxmlapi 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/whoisxmlapi/contact.rb +19 -0
- data/lib/whoisxmlapi/result.rb +4 -4
- data/lib/whoisxmlapi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39e664dd9681096b4aafa9c0820d5a25410b63fd6280302d68d88aa5261f3cbe
|
4
|
+
data.tar.gz: a7848bc7787d4e385cc720969e03d35715a4eb6283641a4a2c7576ddedaaae80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d3b11bd48e46a6dbb06f772c58a75e9016ff3af3a2c9ebed35f0854e51ac69a4654a51f79657d8300fc2d35ee2584a4f18ca6b9fcd34870a40a68c4e15cca30
|
7
|
+
data.tar.gz: 88f0fbaccb75928cc363242e249a8db69d7ca6f97155522d7f821b1ddd5e1c7e8488068b26fd1efb7f7720b39df9709a84ddf14d3a8d1717e04cdc163380fc58
|
data/lib/whoisxmlapi/contact.rb
CHANGED
@@ -23,5 +23,24 @@ module WhoisXMLAPI
|
|
23
23
|
field :email
|
24
24
|
field :telephone
|
25
25
|
field :fax
|
26
|
+
|
27
|
+
def self.selectively_create_from_hash(h)
|
28
|
+
attr = {
|
29
|
+
:name => h['name'],
|
30
|
+
:organization => h['organization'],
|
31
|
+
:street1 => h['street1'],
|
32
|
+
:street2 => h['street2'],
|
33
|
+
:city => h['city'],
|
34
|
+
:state => h['state'],
|
35
|
+
:postalCode => h['postalCode'],
|
36
|
+
:country => h['country'],
|
37
|
+
:countryCode => h['countryCode'],
|
38
|
+
:email => h['email'],
|
39
|
+
:telephone => h['telephone'],
|
40
|
+
:fax => h['fax'],
|
41
|
+
}
|
42
|
+
Contact.create(attr)
|
43
|
+
end
|
44
|
+
|
26
45
|
end
|
27
46
|
end
|
data/lib/whoisxmlapi/result.rb
CHANGED
@@ -57,10 +57,10 @@ module WhoisXMLAPI
|
|
57
57
|
technical_data = record['technicalContact'] || (record['registryData'] ? record['registryData']['technicalContact'] : nil)
|
58
58
|
billing_data = record['billingContact'] || (record['registryData'] ? record['registryData']['billingContact'] : nil)
|
59
59
|
|
60
|
-
self.registrant = WhoisXMLAPI::Contact.
|
61
|
-
self.admin = WhoisXMLAPI::Contact.
|
62
|
-
self.tech = WhoisXMLAPI::Contact.
|
63
|
-
self.billing = WhoisXMLAPI::Contact.
|
60
|
+
self.registrant = WhoisXMLAPI::Contact.selectively_create_from_hash(registrant_data.merge({'email' => record['contactEmail']})) if registrant_data
|
61
|
+
self.admin = WhoisXMLAPI::Contact.selectively_create_from_hash(administrative_data) if administrative_data
|
62
|
+
self.tech = WhoisXMLAPI::Contact.selectively_create_from_hash(technical_data) if technical_data
|
63
|
+
self.billing = WhoisXMLAPI::Contact.selectively_create_from_hash(billing_data) if billing_data
|
64
64
|
end
|
65
65
|
|
66
66
|
def complete?
|
data/lib/whoisxmlapi/version.rb
CHANGED