Class: NominetEPP::Domain::CreateSecDNSExtension
Constant Summary
collapse
- NAMESPACE =
'urn:ietf:params:xml:ns:secDNS-1.1'
Instance Attribute Summary
#namespaces
Instance Method Summary
collapse
#schemaLocation, #schema_name, #set_namespaces, #x_namespace, #x_node, #x_schemaLocation, #xml_namespace, #xml_node
Constructor Details
Returns a new instance of CreateSecDNSExtension.
69
70
71
72
73
|
# File 'lib/nominet-epp/requests/domain/create.rb', line 69
def initialize(attributes)
raise ArgumentError, "must provide Array of Hash or Hash of :key_tag, :alg, :digest_type and :digest" if attributes.nil? || attributes.empty?
@attributes = attributes
@namespaces = {}
end
|
Instance Method Details
#namespace_name ⇒ Object
78
79
80
|
# File 'lib/nominet-epp/requests/domain/create.rb', line 78
def namespace_name
'secDNS'
end
|
#namespace_uri ⇒ Object
75
76
77
|
# File 'lib/nominet-epp/requests/domain/create.rb', line 75
def namespace_uri
NAMESPACE
end
|
#to_xml ⇒ Object
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# File 'lib/nominet-epp/requests/domain/create.rb', line 82
def to_xml
node = x_node('create')
x_schemaLocation(node)
Array(@attributes).each do |attributes|
node << x_node('dsData').tap do |dsData|
dsData << x_node('keyTag', attributes[:key_tag].to_s)
dsData << x_node('alg', attributes[:alg].to_s)
dsData << x_node('digestType', attributes[:digest_type].to_s)
dsData << x_node('digest', attributes[:digest].gsub(/\s+/, ''))
end
end
node
end
|