Class: NominetEPP::Contact::Create

Inherits:
Request
  • Object
show all
Defined in:
lib/nominet-epp/requests/contact/create.rb

Instance Attribute Summary

Attributes inherited from Request

#command, #extension

Instance Method Summary collapse

Methods inherited from Request

#command_name, #namespaces, #xml_namespace, #xml_node

Constructor Details

#initialize(name, options = {}) ⇒ Create

Returns a new instance of Create.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/nominet-epp/requests/contact/create.rb', line 4

def initialize(name, options = {})
  @name = name
  @options = options
  @namespaces = {}

  @extensions = @options.dup
  @extensions.delete_if { |k,_| !CreateExtension::KEYS.include?(k) }
  @options.delete_if    { |k,_|  CreateExtension::KEYS.include?(k) }

  @options[:auth_info] ||= {:pw => SecureRandom.hex(8) }

  @contact_ext = CreateExtension.new(@extensions) rescue nil

  @command    = EPP::Contact::Create.new(@name, @options)
  @extension  = EPP::Requests::Extension.new(@contact_ext) rescue nil
end