Improve DomainCreate wrapper for EPP

This commit is contained in:
Karl Erik Õunapuu 2020-12-08 18:06:48 +02:00
parent ccef1053d9
commit ad2ccdba7d
No known key found for this signature in database
GPG key ID: C9DD647298A34764
7 changed files with 53 additions and 124 deletions

View file

@ -15,7 +15,7 @@ module Deserializers
registrar_id: registrar,
registrant_id: if_present('registrant'),
reserved_pw: if_present('reserved > pw'),
period: Integer(frame.css('period').text) || 1,
period: frame.css('period').text.present? ? Integer(frame.css('period').text) : 1,
period_unit: frame.css('period').first ? frame.css('period').first[:unit] : 'y',
}

View file

@ -32,11 +32,11 @@ module Deserializers
end
def admin_contacts
frame.css('contact').map { |c| c.text if c['type'] == 'admin' }
frame.css('contact').select { |c| c['type'] == 'admin' }.map(&:text)
end
def tech_contacts
frame.css('contact').map { |c| c.text if c['type'] == 'tech' }
frame.css('contact').select { |c| c['type'] == 'tech' }.map(&:text)
end
def dns_keys