Module: NominetEPP::Operations::Info

Included in:
Client
Defined in:
lib/nominet-epp/operations/info.rb

Overview

EPP Info Operation

Instance Method Summary collapse

Instance Method Details

#info(entity, id) ⇒ false, Hash

Parameters:

  • entity (Symbol)

    Type of entity to get information about

  • id (String)

    Identifier of the entity

Returns:

  • (false)

    failed

  • (Hash)

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/nominet-epp/operations/info.rb', line 9

def info(entity, id)
  raise ArgumentError, "entity must be :domain, :contact or :account" unless [:domain, :contact, :account].include?(entity)

  @resp = @client.info do
    case entity
    when :domain
      domain('info') { |node, ns| node << XML::Node.new('name', id, ns) }
    when :account
      ('info') { |node, ns| node << XML::Node.new('roid', id, ns) }
    when :contact
      contact('info') { |node, ns| node << XML::Node.new('roid', id, ns) }
    end
  end

  return false unless @resp.success?
  self.send(:"info_#{entity}", @resp.data)
end