Class: EPP::Contact::InfoResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/epp-client/contact/info_response.rb

Instance Method Summary collapse

Methods inherited from Response

#initialize, #method, #method_missing, #respond_to?, #respond_to_missing?

Methods included from ResponseHelper

#nodes_for_xpath, #value_for_xpath, #values_for_xpath

Constructor Details

This class inherits a constructor from EPP::Contact::Response

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EPP::Contact::Response

Instance Method Details

#auth_infoObject



59
60
61
62
63
# File 'lib/epp-client/contact/info_response.rb', line 59

def auth_info
  @auth_info ||= begin
    { 'pw' => value_for_xpath('//contact:authInfo/contact:pw') }
  end
end

#client_idObject



41
42
43
# File 'lib/epp-client/contact/info_response.rb', line 41

def client_id
  @clid ||= value_for_xpath('//contact:clID')
end

#created_dateObject



47
48
49
# File 'lib/epp-client/contact/info_response.rb', line 47

def created_date
  @crdate ||= value_for_xpath('//contact:crDate') && Time.parse(value_for_xpath('//contact:crDate'))
end

#creator_idObject



44
45
46
# File 'lib/epp-client/contact/info_response.rb', line 44

def creator_id
  @crid ||= value_for_xpath('//contact:crID')
end

#discloseObject



64
65
66
67
68
69
70
71
# File 'lib/epp-client/contact/info_response.rb', line 64

def disclose
  @disclose ||= begin
    nodes_for_xpath('//contact:disclose').inject({}) do |hash, node|
      hash[node['flag'].to_s] = node.children.reject{|n| n.empty?}.map { |child| child.name }
      hash
    end
  end
end

#emailObject



15
16
17
# File 'lib/epp-client/contact/info_response.rb', line 15

def email
  @email ||= value_for_xpath('//contact:email')
end

#faxObject



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

def fax
  @fax ||= value_for_xpath('//contact:fax') do |node|
    [node.content.strip, node['x']].compact.join(".")
  end
end

#idObject



6
7
8
# File 'lib/epp-client/contact/info_response.rb', line 6

def id
  @id ||= value_for_xpath('//contact:id')
end

#postal_infoObject



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/epp-client/contact/info_response.rb', line 28

def postal_info
  @postal_info ||= {
    :name => value_for_xpath('//contact:postalInfo/contact:name'),
    :org  => value_for_xpath('//contact:postalInfo/contact:org'),
    :addr => {
      :street => values_for_xpath('//contact:postalInfo/contact:addr/contact:street').join("\n"),
      :city   => value_for_xpath('//contact:postalInfo/contact:addr/contact:city'),
      :sp     => value_for_xpath('//contact:postalInfo/contact:addr/contact:sp'), 
      :pc     => value_for_xpath('//contact:postalInfo/contact:addr/contact:pc'),
      :cc     => value_for_xpath('//contact:postalInfo/contact:addr/contact:cc')
    }
  }
end

#roidObject



9
10
11
# File 'lib/epp-client/contact/info_response.rb', line 9

def roid
  @roid ||= value_for_xpath('//contact:roid')
end

#statusObject



12
13
14
# File 'lib/epp-client/contact/info_response.rb', line 12

def status
  @status ||= values_for_xpath('//contact:status/@s')
end

#transfer_dateObject



56
57
58
# File 'lib/epp-client/contact/info_response.rb', line 56

def transfer_date
  @trdate ||= value_for_xpath('//contact:trDate') && Time.parse(value_for_xpath('//contact:trDate'))
end

#updated_dateObject



53
54
55
# File 'lib/epp-client/contact/info_response.rb', line 53

def updated_date
  @update ||= value_for_xpath('//contact:upDate') && Time.parse(value_for_xpath('//contact:upDate'))
end

#updator_idObject



50
51
52
# File 'lib/epp-client/contact/info_response.rb', line 50

def updator_id
  @upid ||= value_for_xpath('//contact:upID')
end

#voiceObject



23
24
25
26
27
# File 'lib/epp-client/contact/info_response.rb', line 23

def voice
  @voice ||= value_for_xpath('//contact:voice') do |node|
    [node.content.strip, node['x']].compact.join(".")
  end
end