Class: EPP::Domain::Transfer

Inherits:
Command
  • Object
show all
Defined in:
lib/epp-client/domain/transfer.rb

Instance Attribute Summary

Attributes inherited from Command

#namespaces

Instance Method Summary collapse

Methods inherited from Command

#set_namespaces

Methods included from XMLHelpers

#as_xml, #epp_namespace, #epp_node, #xml_document, #xml_namespace, #xml_node

Constructor Details

#initialize(name, period = nil, auth_info = {}) ⇒ Transfer

@auth_info should be an XML::Node with whatever is required



7
8
9
10
11
12
13
14
# File 'lib/epp-client/domain/transfer.rb', line 7

def initialize(name, period = nil, auth_info = {})
  @name = name
  @auth_info = auth_info
  
  if period
    @period_val, @period_unit = validate_period(period)
  end
end

Instance Method Details

#nameObject



16
17
18
# File 'lib/epp-client/domain/transfer.rb', line 16

def name
  'transfer'
end

#to_xmlObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/epp-client/domain/transfer.rb', line 20

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

  node << auth_info_to_xml(@auth_info) unless @auth_info.empty?

  node
end