Class: EPP::Requests::Extension
- Defined in:
- lib/epp-client/requests/extension.rb
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#initialize(*extensions) ⇒ Extension
constructor
A new instance of Extension.
- #name ⇒ Object
- #to_xml ⇒ Object
Methods inherited from Abstract
Methods included from XMLHelpers
#as_xml, #epp_namespace, #epp_node, #xml_document, #xml_namespace, #xml_node
Constructor Details
#initialize(*extensions) ⇒ Extension
Returns a new instance of Extension.
6 7 8 9 |
# File 'lib/epp-client/requests/extension.rb', line 6 def initialize(*extensions) raise ArgumentError, "you must provide at least one extension" if extensions.compact.empty? @extensions = extensions.compact end |
Instance Method Details
#name ⇒ Object
11 12 13 |
# File 'lib/epp-client/requests/extension.rb', line 11 def name 'extension' end |
#to_xml ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/epp-client/requests/extension.rb', line 15 def to_xml node = super Array(@extensions).each do |extension| next if extension.nil? extension.set_namespaces(@namespaces) if extension.respond_to?(:set_namespaces) node << as_xml(extension) end node end |