Class: EPP::Domain::Create
- Defined in:
- lib/epp-client/domain/create.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ EPP::Domain::Create
constructor
Domain creation command.
- #name ⇒ Object
- #to_xml ⇒ Object
Methods inherited from Command
Methods included from XMLHelpers
#as_xml, #epp_namespace, #epp_node, #xml_document, #xml_namespace, #xml_node
Constructor Details
#initialize(name, options = {}) ⇒ EPP::Domain::Create
Domain creation command.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/epp-client/domain/create.rb', line 35 def initialize(name, = {}) @name = name @period = .delete(:period) || '1y' @nameservers = Array(.delete(:nameservers)) @registrant = .delete(:registrant) @contacts = .delete(:contacts) @auth_info = .delete(:auth_info) @period_val, @period_unit = validate_period(@period) end |
Instance Method Details
#name ⇒ Object
46 47 48 |
# File 'lib/epp-client/domain/create.rb', line 46 def name 'create' end |
#to_xml ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/epp-client/domain/create.rb', line 50 def to_xml node = super node << domain_node('name', @name) if @period_val && @period_unit p = domain_node('period', @period_val) p['unit'] = @period_unit node << p end unless @nameservers.empty? node << nameservers_to_xml(@nameservers) end node << domain_node('registrant', @registrant) if @registrant contacts_to_xml(node, @contacts) node << auth_info_to_xml(@auth_info) unless @auth_info.empty? node end |