Class: NominetEPP::Custom::Handshake

Inherits:
NominetEPP::CustomRequest show all
Defined in:
lib/nominet-epp/requests/custom/handshake.rb

Constant Summary collapse

NAMESPACE =
'http://www.nominet.org.uk/epp/xml/std-handshake-1.0'

Instance Attribute Summary

Attributes inherited from Request

#command, #extension

Instance Method Summary collapse

Methods inherited from NominetEPP::CustomRequest

#command, #namespaces, #schemaLocation, #schema_name, #set_namespaces, #x_namespace, #x_node, #x_schemaLocation

Methods inherited from Request

#namespaces, #xml_namespace, #xml_node

Constructor Details

#initialize(case_id, registrant = nil) ⇒ Handshake

Returns a new instance of Handshake.



6
7
8
9
# File 'lib/nominet-epp/requests/custom/handshake.rb', line 6

def initialize(case_id, registrant = nil)
  @case_id = case_id
  @registrant = registrant
end

Instance Method Details

#command_nameObject



11
12
13
# File 'lib/nominet-epp/requests/custom/handshake.rb', line 11

def command_name
  'update'
end

#namespace_nameObject



14
15
16
# File 'lib/nominet-epp/requests/custom/handshake.rb', line 14

def namespace_name
  'h'
end

#namespace_uriObject



17
18
19
# File 'lib/nominet-epp/requests/custom/handshake.rb', line 17

def namespace_uri
  NAMESPACE
end

#to_xmlObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/nominet-epp/requests/custom/handshake.rb', line 21

def to_xml
  @namespaces ||= {}
  node = x_node('accept')
  x_schemaLocation(node)

  node << x_node('caseId', @case_id)
  
  if @registrant
    node << x_node('registrant', @registrant)
  end

  node
end