Class: NominetEPP::Domain::UpdateExtension
Constant Summary
collapse
- KEYS =
[:first_bill, :recur_bill, :auto_bill, :next_bill,
:auto_period, :next_period, :renew_not_required, :notes, :reseller]
- NAMESPACE =
'http://www.nominet.org.uk/epp/xml/domain-nom-ext-1.2'
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 UpdateExtension.
34
35
36
37
38
|
# File 'lib/nominet-epp/requests/domain/update.rb', line 34
def initialize(attributes)
raise ArgumentError, "must provide Hash of #{KEYS.map(&:inspect).join(", ")}" if attributes.nil? || attributes.empty?
@attributes = attributes
@namespaces = {}
end
|
Instance Method Details
#namespace_name ⇒ Object
43
44
45
|
# File 'lib/nominet-epp/requests/domain/update.rb', line 43
def namespace_name
'domain-ext'
end
|
#namespace_uri ⇒ Object
40
41
42
|
# File 'lib/nominet-epp/requests/domain/update.rb', line 40
def namespace_uri
NAMESPACE
end
|
#to_xml ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/nominet-epp/requests/domain/update.rb', line 47
def to_xml
node = x_node('update')
x_schemaLocation(node)
KEYS.each do |key|
value = @attributes[key]
next if value.nil? || value == ''
case key
when :notes
Array(value).each do |note|
node << x_node('notes', note)
end
when :renew_not_required
node << x_node('renew-not-required', value ? 'Y' : 'N')
else
name = key.to_s.gsub('_', '-')
node << x_node(name, value.to_s)
end
end
node
end
|