Class: NominetEPP::Domain::Check

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

Defined Under Namespace

Classes: DirectRightsExtension

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(*names) ⇒ Check

Returns a new instance of Check.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/nominet-epp/requests/domain/check.rb', line 4

def initialize(*names)
  rights = names.last.is_a?(Hash) ? names.pop : nil
  names  = names.compact # handle nil being passed for rights

  @command = EPP::Domain::Check.new(*names)

  if rights && !rights.empty?
    raise ArgumentError, "cannot check direct rights on more than one name" if names.count > 1
    @rights_ext = DirectRightsExtension.new(rights)
    @extension  = EPP::Requests::Extension.new(@rights_ext) rescue nil
  end
end