namecheap-client 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/namecheap-client.rb +11 -4
- 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: f1bcf23bd469fa4342bb5b6b2f95b55c159ae97f27bb2be711868f79964a5429
|
4
|
+
data.tar.gz: 7a94aeb933aca1d619a87835ab74837015bdcb729c7a10403abdec24f3d0e1b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3c37fd4ebac4830b7e9d0bd0ffdaef2fba725b363de2ee51d0684febf01887ece815c0b8f7333a5241682f374aa5248b72efc2efc181c39b72da444931c7711
|
7
|
+
data.tar.gz: 4d85b6ed4ba2a748813b6977e14675ec88c5f6f5fe5bafe4c83bcfea67632f25fe3d894fd52e0fbb1bdad39a68921a74afc252adfc3283046f8013194f6ecfcd
|
data/lib/namecheap-client.rb
CHANGED
@@ -134,17 +134,24 @@ class NamecheapClient
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def parse_dns_records(xml_response)
|
137
|
+
namespaces = { 'nc' => 'http://api.namecheap.com/xml.response' }
|
137
138
|
records = []
|
138
|
-
xml_response.xpath('//DomainDNSGetHostsResult/host').each do |host_node|
|
139
|
+
xml_response.xpath('//nc:DomainDNSGetHostsResult/nc:host', namespaces).each do |host_node|
|
139
140
|
records << {
|
140
|
-
'
|
141
|
+
'HostId' => host_node['HostId'],
|
141
142
|
'Name' => host_node['Name'],
|
143
|
+
'Type' => host_node['Type'],
|
142
144
|
'Address' => host_node['Address'],
|
143
|
-
'
|
145
|
+
'MXPref' => host_node['MXPref'],
|
146
|
+
'TTL' => host_node['TTL'],
|
147
|
+
'AssociatedAppTitle' => host_node['AssociatedAppTitle'],
|
148
|
+
'FriendlyName' => host_node['FriendlyName'],
|
149
|
+
'IsActive' => host_node['IsActive'],
|
150
|
+
'IsDDNSEnabled' => host_node['IsDDNSEnabled']
|
144
151
|
}
|
145
152
|
end
|
146
153
|
records
|
147
|
-
end
|
154
|
+
end
|
148
155
|
|
149
156
|
def parse_errors(xml_response)
|
150
157
|
errors = xml_response.xpath('//Errors/Error').map(&:text)
|