Class: NominetEPP::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/nominet-epp/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



3
4
5
# File 'lib/nominet-epp/request.rb', line 3

def command
  @command
end

#extensionObject (readonly)

Returns the value of attribute extension.



3
4
5
# File 'lib/nominet-epp/request.rb', line 3

def extension
  @extension
end

Instance Method Details

#command_nameObject



5
6
7
# File 'lib/nominet-epp/request.rb', line 5

def command_name
  @command_name ||= command.name
end

#namespacesObject



9
10
11
12
# File 'lib/nominet-epp/request.rb', line 9

def namespaces
  ext_ns = @extension && @extension.namespaces || {}
  @command.namespaces.merge(ext_ns)
end

#xml_namespace(node, name, uri, namespaces = {}) ⇒ XML::Namespace

Creates and returns a new XML namespace

Parameters:

  • node (XML::Node)

    XML node to add the namespace to

  • name (String)

    Name of the namespace to create

  • uri (String)

    URI of the namespace to create

Returns:

  • (XML::Namespace)


29
30
31
# File 'lib/nominet-epp/request.rb', line 29

def xml_namespace(node, name, uri, namespaces = {})
  XML::Namespace.new(node, name, uri)
end

#xml_node(name, value = nil) ⇒ XML::Node

Creates and returns a new XML node

Parameters:

  • name (String)

    of the node to create

  • value (String, XML::Node, nil) (defaults to: nil)

    of the node

Returns:

  • (XML::Node)


19
20
21
# File 'lib/nominet-epp/request.rb', line 19

def xml_node(name, value = nil)
  XML::Node.new(name, value)
end