zaig 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: 99e8d4eed3c1a4bbc45134a8aff616695b0a0fd7e4c9d9819788a3f13c96ba87
4
- data.tar.gz: 6a93abf41c8287aac05c195c7d77300b63bcb17174132fc3fb5b4e6b668cc06a
3
+ metadata.gz: 00531b692d17cf8b508317410d44fd193c247f49b73579f1c836199e457a43c1
4
+ data.tar.gz: b156aa4e304031c1c65397ac458e9430038d84c7223352b7add307551ee9348d
5
5
  SHA512:
6
- metadata.gz: 95f18c8313813486b95bb353ae378a982420ed45789114c05167608fe15e263022b6ab1ecf4fdb2b837d220a8c133714a69f7c6ca512283a01f67609e60a1c60
7
- data.tar.gz: b15e3c9ee02b971ec249f7368ace43d8b67a2ecb0b0af4558e7e14cc3b69d2ea71ecf614cb8a9cbdb7c4073039727368923fced0141ce258707c81d37064b99c
6
+ metadata.gz: 4da7e1c681ab55b6ace31c91cda4514076ffb414c8cbfffb98325514c2dafb46b9528c7608169082aa7b4ef89b2caf95a7210835f56fce796b4f7c7d55df022e
7
+ data.tar.gz: 1e7ef1819184ec0c8a208e7b7b546f4fdd14ac58ef926d029a9ee9c55f3a3d1834b31273a84f32d2d254fb5c122a499dadb8207548c3b1ca03e2a57cd80c146f
@@ -11,7 +11,7 @@ module Zaig
11
11
  {
12
12
  address: build_address(obj["address"]),
13
13
  client_category: obj["client_category"],
14
- constitution_date: obj["constitution_date"],
14
+ constitution_date: Date.parse(obj["constitution_date"]).to_s,
15
15
  constitution_type: obj["constitution_type"],
16
16
  credit_request_date: obj["credit_request_date"],
17
17
  credit_type: obj["credit_type"] || "clean",
@@ -63,6 +63,8 @@ module Zaig
63
63
  end
64
64
 
65
65
  def build_shareholders(obj_shareholders)
66
+ return nil if obj_shareholders.nil?
67
+
66
68
  shareholders = []
67
69
 
68
70
  obj_shareholders.each do |s|
@@ -86,6 +88,8 @@ module Zaig
86
88
  end
87
89
 
88
90
  def build_financial(fin)
91
+ return nil if fin.nil?
92
+
89
93
  {
90
94
  amount: fin["amount"],
91
95
  annual_interest_rate: fin["annual_interest_rate"],
@@ -97,6 +101,8 @@ module Zaig
97
101
  end
98
102
 
99
103
  def build_warrants(obj_warrants)
104
+ return nil if obj_warrants.nil?
105
+
100
106
  warrants = []
101
107
 
102
108
  obj_warrants.each do |w|
@@ -112,6 +118,8 @@ module Zaig
112
118
  end
113
119
 
114
120
  def build_source(obj_source)
121
+ return nil if obj_source.nil?
122
+
115
123
  {
116
124
  channel: obj_source["channel"],
117
125
  ip: obj_source["ip"],
@@ -120,6 +128,8 @@ module Zaig
120
128
  end
121
129
 
122
130
  def build_scr_parameters(obj_src)
131
+ return nil if obj_src.nil?
132
+
123
133
  {
124
134
  signers: build_signers(obj_src["signers"]),
125
135
  signature_evidence: {
@@ -135,6 +145,8 @@ module Zaig
135
145
  end
136
146
 
137
147
  def build_signers(obj_signers)
148
+ return nil if obj_signers.nil?
149
+
138
150
  signers = []
139
151
  obj_signers.each do |s|
140
152
  signers << {
data/lib/zaig/version.rb CHANGED
@@ -8,5 +8,5 @@ module Zaig
8
8
  # Major - Incremented for incompatible changes with previous release (or big enough new features)
9
9
  # Minor - Incremented for new backwards-compatible features + deprecations
10
10
  # Patch - Incremented for backwards-compatible bug fixes
11
- VERSION = "1.0.2"
11
+ VERSION = "1.0.3"
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaig
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Carolino