Class: EPP::Commands::Command

Inherits:
Object
  • Object
show all
Includes:
XMLHelpers
Defined in:
lib/epp-client/commands/command.rb

Direct Known Subclasses

Login, Logout, Poll, ReadWriteCommand

Instance Method Summary collapse

Methods included from XMLHelpers

#as_xml, #epp_namespace, #epp_node, #xml_document, #xml_namespace, #xml_node

Instance Method Details

#set_namespaces(namespaces) ⇒ Object



6
7
8
# File 'lib/epp-client/commands/command.rb', line 6

def set_namespaces(namespaces)
  @namespaces = namespaces
end

#to_s(opts = {}) ⇒ Object

Convert the receiver to a string

Parameters:

  • opts (Hash) (defaults to: {})

    Formatting options, passed to the XML::Document



19
20
21
# File 'lib/epp-client/commands/command.rb', line 19

def to_s(opts = {})
  to_xml.to_s({:indent => false}.merge(opts))
end

#to_xmlXML::Document

Receiver in XML form

Returns:

  • (XML::Document)

    XML of the receiver



12
13
14
# File 'lib/epp-client/commands/command.rb', line 12

def to_xml
  epp_node(name, @namespaces || {})
end