Class: EPP::Contact::Create

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

Constant Summary

Constants inherited from Command

EPP::Contact::Command::DISCLOSE_ORDER, EPP::Contact::Command::MAX_STREETS

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(id, options = {}) ⇒ Create

Returns a new instance of Create.



6
7
8
9
10
11
12
13
14
15
# File 'lib/epp-client/contact/create.rb', line 6

def initialize(id, options = {})
  @id = id

  @postal_info  = options.delete(:postal_info)
  @voice        = options.delete(:voice)
  @fax          = options.delete(:fax)
  @email        = options.delete(:email)
  @auth_info    = options.delete(:auth_info)
  @disclose     = options.delete(:disclose)
end

Instance Method Details

#nameObject



17
18
19
# File 'lib/epp-client/contact/create.rb', line 17

def name
  'create'
end

#to_xmlObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/epp-client/contact/create.rb', line 21

def to_xml
  node = super
  node << contact_node('id', @id)
  node << postal_info_to_xml(@postal_info)
  node << contact_node('voice', @voice) if @voice
  node << contact_node('fax', @fax) if @fax
  node << contact_node('email', @email)
  node << auth_info_to_xml(@auth_info)
  node << disclose_to_xml(@disclose) if @disclose
  node
end