epp-xml 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 142969b82d949261109814c2b191204d2a122423
4
- data.tar.gz: 836f7c3935770592da472e9952ff962fa55bb455
3
+ metadata.gz: e8ecdf055fc60d2165333b26890a4468e2cca8eb
4
+ data.tar.gz: c3cedc145e9b3cc61eb0ee54594baf0d826ffeb8
5
5
  SHA512:
6
- metadata.gz: d7bbc2ad8b23cd36130613505f6def714546febd00805e72b1aa3a74e4a75a973f6266ce7ada7f6b62ed5a9d5f75357d77ce8372620a15b9a8c025cacc4ba381
7
- data.tar.gz: 5a692c5e3fc026f38fd200fd3b78dacfdfa93338dccc25a3b61db67840e01ad684f0d7bb057f31fe94699fda55f28ee6abd41c4e1e7b55bc731dcfa117018af3
6
+ metadata.gz: f001b44e7ab189e32449e9bdf3026e047a40fea22cdfccf3c242730917b842d27b62f50fb2cc7e0df011e94147a16068017334470f457f3916d996eed00af942
7
+ data.tar.gz: cf25c49ae2c099f185dec83f03da77510d8009f9a37e9278185398cd780ba2ae127044c87bde4abd9b073537c5ce485a14d8f8cc9793647d937571a82a85588f
@@ -1,5 +1,7 @@
1
- module EppXmlCore
2
- module Contact
1
+ module EppXml
2
+ class Contact
3
+ include EppXml
4
+
3
5
  def create(xml_params = {})
4
6
  build('create', xml_params)
5
7
  end
@@ -31,7 +33,7 @@ module EppXmlCore
31
33
  EppXml.generate_xml_from_hash(xml_params, xml, 'contact:')
32
34
  end
33
35
  end
34
- xml.clTRID(EppXml.clTRID)
36
+ xml.clTRID(clTRID)
35
37
  end
36
38
  end
37
39
  end
@@ -49,7 +51,7 @@ module EppXmlCore
49
51
  EppXml.generate_xml_from_hash(xml_params, xml, 'contact:')
50
52
  end
51
53
  end
52
- xml.clTRID(EppXml.clTRID)
54
+ xml.clTRID(clTRID)
53
55
  end
54
56
  end
55
57
  end
@@ -1,5 +1,7 @@
1
- module EppXmlCore
2
- module Domain
1
+ module EppXml
2
+ class Domain
3
+ include EppXml
4
+
3
5
  def info(xml_params = {})
4
6
  build('info', xml_params)
5
7
  end
@@ -32,7 +34,7 @@ module EppXmlCore
32
34
  EppXml.generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
33
35
  end
34
36
  end if dnssec_params != false
35
- xml.clTRID(EppXml.clTRID)
37
+ xml.clTRID(clTRID)
36
38
  end
37
39
  end
38
40
  end
@@ -54,7 +56,7 @@ module EppXmlCore
54
56
  EppXml.generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
55
57
  end
56
58
  end if dnssec_params != false
57
- xml.clTRID(EppXml.clTRID)
59
+ xml.clTRID(clTRID)
58
60
  end
59
61
  end
60
62
  end
@@ -70,7 +72,7 @@ module EppXmlCore
70
72
  EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
71
73
  end
72
74
  end
73
- xml.clTRID(EppXml.clTRID)
75
+ xml.clTRID(clTRID)
74
76
  end
75
77
  end
76
78
  end
@@ -88,7 +90,7 @@ module EppXmlCore
88
90
  EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
89
91
  end
90
92
  end
91
- xml.clTRID(EppXml.clTRID)
93
+ xml.clTRID(clTRID)
92
94
  end
93
95
  end
94
96
  end
@@ -1,5 +1,7 @@
1
- module EppXmlCore
2
- module Keyrelay
1
+ module EppXml
2
+ class Keyrelay
3
+ include EppXml
4
+
3
5
  def keyrelay(xml_params = {})
4
6
  xml = Builder::XmlMarkup.new
5
7
 
@@ -28,7 +30,7 @@ module EppXmlCore
28
30
  end if xml_params[:expiry]
29
31
 
30
32
  end
31
- xml.tag!('ext:clTRID', EppXml.clTRID)
33
+ xml.tag!('ext:clTRID', clTRID)
32
34
  end
33
35
  end
34
36
  end
@@ -1,5 +1,7 @@
1
- module EppXmlCore
2
- module Session
1
+ module EppXml
2
+ class Session
3
+ include EppXml
4
+
3
5
  def login(xml_params = {})
4
6
  defaults = {
5
7
  clID: { value: 'user' },
@@ -29,7 +31,7 @@ module EppXmlCore
29
31
  xml.login do
30
32
  EppXml.generate_xml_from_hash(xml_params, xml)
31
33
  end
32
- xml.clTRID(EppXml.clTRID)
34
+ xml.clTRID(clTRID)
33
35
  end
34
36
  end
35
37
  end
@@ -47,7 +49,7 @@ module EppXmlCore
47
49
  xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
48
50
  xml.command do
49
51
  EppXml.generate_xml_from_hash(xml_params, xml)
50
- xml.clTRID(EppXml.clTRID)
52
+ xml.clTRID(clTRID)
51
53
  end
52
54
  end
53
55
 
data/lib/epp-xml.rb CHANGED
@@ -6,29 +6,20 @@ require 'epp-xml/contact'
6
6
  require 'epp-xml/keyrelay'
7
7
 
8
8
  module EppXml
9
- class Session
10
- extend ::EppXmlCore::Session
11
- end
12
-
13
- class Domain
14
- extend ::EppXmlCore::Domain
15
- end
9
+ attr_accessor :cl_trid_prefix, :cl_trid
16
10
 
17
- class Contact
18
- extend ::EppXmlCore::Contact
11
+ def initialize(args = {})
12
+ self.cl_trid = args[:cl_trid]
13
+ self.cl_trid_prefix = args[:cl_trid_prefix]
19
14
  end
20
15
 
21
- class Keyrelay
22
- extend ::EppXmlCore::Keyrelay
16
+ def clTRID
17
+ return cl_trid if cl_trid
18
+ return "#{cl_trid_prefix}-#{Time.now.to_i}" if cl_trid_prefix
19
+ Time.now.to_i
23
20
  end
24
21
 
25
22
  class << self
26
- attr_accessor :cl_trid_prefix, :cl_trid
27
-
28
- def clTRID
29
- cl_trid || "#{cl_trid_prefix}-#{Time.now.to_i}"
30
- end
31
-
32
23
  def generate_xml_from_hash(xml_params, xml, ns = '')
33
24
  xml_params.each do |k, v|
34
25
  # Value is a hash which has string type value
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epp-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GiTLAB LTD