Class: EPP::Commands::Transfer

Inherits:
ReadWriteCommand show all
Defined in:
lib/epp-client/commands/transfer.rb

Constant Summary collapse

OPERATIONS =
%w(approve cancel query reject request)

Instance Method Summary collapse

Methods inherited from Command

#set_namespaces, #to_s

Methods included from XMLHelpers

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

Constructor Details

#initialize(op, command) ⇒ Transfer

Returns a new instance of Transfer.

Raises:

  • (ArgumentError)


8
9
10
11
12
13
# File 'lib/epp-client/commands/transfer.rb', line 8

def initialize(op, command)
  raise ArgumentError, "op must be one of #{OPERATIONS.join(', ')}" unless OPERATIONS.include?(op)

  super command
  @op = op
end

Instance Method Details

#nameObject



14
15
16
# File 'lib/epp-client/commands/transfer.rb', line 14

def name
  'transfer'
end

#to_xmlObject



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

def to_xml
  node = super
  node['op'] = @op
  node
end