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 = {}) ⇒ Create
constructor
A new instance of Create.
- #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 = {}) ⇒ Create
Returns a new instance of Create.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/epp-client/domain/create.rb', line 17 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
28 29 30 |
# File 'lib/epp-client/domain/create.rb', line 28 def name 'create' end |
#to_xml ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/epp-client/domain/create.rb', line 32 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 |