Class: EppXml::Session
  
  
  
  Instance Attribute Summary
  
  
  #cl_trid, #cl_trid_prefix
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  #clTRID, #initialize
  
    Instance Method Details
    
      
  
  
    #login(xml_params = {})  ⇒ Object 
  
  
  
  
    | 
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 | # File 'lib/epp-xml/session.rb', line 7
def login(xml_params = {})
  defaults = {
    clID: { value: 'user' },
    pw: { value: 'pw' },
    options: {
      version: { value: '1.0' },
      lang: { value: 'en' }
    },
    svcs: {
      _objURIs: [
        objURI: { value: 'urn:ietf:params:xml:ns:contact-1.0' }
      ]
    }
  }
  xml_params = defaults.deep_merge(xml_params)
  xml = Builder::XmlMarkup.new
  xml.instruct!(:xml, standalone: 'no')
  xml.epp(
    'xmlns' => 'urn:ietf:params:xml:ns:epp-1.0',
    'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
    'xsi:schemaLocation' => 'urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd'
  ) do
    xml.command do
      xml.login do
        EppXml.generate_xml_from_hash(xml_params, xml)
      end
      xml.clTRID(clTRID)
    end
  end
end | 
 
    
      
  
  
    #poll(xml_params = {}, custom_params = {})  ⇒ Object 
  
  
  
  
    | 
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 | # File 'lib/epp-xml/session.rb', line 41
def poll(xml_params = {}, custom_params = {})
  defaults = {
    poll: { value: '', attrs: { op: 'req' } }
  }
  xml_params = defaults.deep_merge(xml_params)
  xml = Builder::XmlMarkup.new
  xml.instruct!(:xml, standalone: 'no')
  xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
    xml.command do
      EppXml.generate_xml_from_hash(xml_params, xml)
      EppXml.custom_ext(xml, custom_params)
      xml.clTRID(clTRID)
    end
  end
end |