istox 0.2.5.3.pre.51 → 0.2.5.3.pre.52
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d40b03190a4031801135b746396d633f859011765e6dbda5f033121eb6b18ba
|
4
|
+
data.tar.gz: 27d7a3334d086abc719e50e772f9db988a5f2a725d88c6de887294fe6acc7140
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c2e04d496e6316556d8812504cbaab020a4d1e0111d9c9419bd2ee9c2d70fa615ceaaf00ad40b034506e3b2e19f5ce73998dfbfdaae9bb1aed81c03bd7db52f
|
7
|
+
data.tar.gz: 6bbf9414ea1eb3319e74ecf49a5600e800ef807a74f149967d7b253aeae6fa64e57d77d25de7aa94cb735dcdca439141df427e20cfb45ba6ac18a3f238e267ab
|
@@ -149,10 +149,8 @@ module Istox
|
|
149
149
|
next unless ce[:email].present?
|
150
150
|
|
151
151
|
copy_email_data[:email] = ce[:email]
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
copy_email_data = copy_email_data.merge(ce[:params])
|
152
|
+
copy_email_data[:sid] = ce[:sid]
|
153
|
+
copy_email_data = copy_email_data.merge(ce[:params]) if ce[:params].present?
|
156
154
|
end
|
157
155
|
|
158
156
|
copy_email_data.delete(:copy_emails)
|
data/lib/istox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: istox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.5.3.pre.
|
4
|
+
version: 0.2.5.3.pre.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
@@ -494,7 +494,6 @@ files:
|
|
494
494
|
- lib/istox.rb
|
495
495
|
- lib/istox/constants/error.rb
|
496
496
|
- lib/istox/consumers/blockchain_status_handler.rb
|
497
|
-
- lib/istox/helpers/_tmp_07f8e7bcecafce66_common_helper.rb.rb
|
498
497
|
- lib/istox/helpers/blockchain_service.rb
|
499
498
|
- lib/istox/helpers/bunny_boot.rb
|
500
499
|
- lib/istox/helpers/common_helper.rb
|
@@ -1,67 +0,0 @@
|
|
1
|
-
module Istox
|
2
|
-
module CommonHelper
|
3
|
-
def self.to_datetime(input)
|
4
|
-
return nil if input.blank?
|
5
|
-
|
6
|
-
begin
|
7
|
-
is_numeric = true if Integer input
|
8
|
-
rescue StandardError
|
9
|
-
false
|
10
|
-
end
|
11
|
-
|
12
|
-
# is unix timestamp
|
13
|
-
is_numeric ? Time.at(input.to_i).to_datetime : Time.parse(input)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.to_boolean(input)
|
17
|
-
!(input.blank? || input.to_s.downcase == 'false' || input.to_s.downcase == '0')
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.to_open_struct(model)
|
21
|
-
return nil if model.nil?
|
22
|
-
|
23
|
-
if model.is_a?(Array)
|
24
|
-
model.map do |item|
|
25
|
-
hash = deep_to_h(item).deep_transform_keys { |key| key.to_s.underscore.to_sym }
|
26
|
-
to_recursive_ostruct(hash)
|
27
|
-
end
|
28
|
-
else
|
29
|
-
hash = deep_to_h(model).deep_transform_keys { |key| key.to_s.underscore.to_sym }
|
30
|
-
to_recursive_ostruct(hash)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.to_recursive_ostruct(obj)
|
35
|
-
if obj.is_a?(Hash)
|
36
|
-
::Istox::MyOpenStruct.new(obj.map { |key, val| [key, to_recursive_ostruct(val)] }.to_h)
|
37
|
-
elsif obj.is_a?(Array)
|
38
|
-
obj.map { |o| to_recursive_ostruct(o) }
|
39
|
-
elsif obj.is_a?(OpenStruct)
|
40
|
-
::Istox::MyOpenStruct.new(obj)
|
41
|
-
else # Assumed to be a primitive value
|
42
|
-
obj
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def self.deep_to_h(obj)
|
47
|
-
if obj.is_a?(Array)
|
48
|
-
obj.map { |r| deep_to_h(r) }
|
49
|
-
elsif obj.is_a?(OpenStruct) || obj.is_a?(Hash) || (obj.methods.include?(:to_h) && obj.present?)
|
50
|
-
obj.to_h.transform_values do |v|
|
51
|
-
if v.is_a?(OpenStruct) || v.is_a?(Array)
|
52
|
-
deep_to_h(v)
|
53
|
-
else
|
54
|
-
v
|
55
|
-
end
|
56
|
-
end
|
57
|
-
else
|
58
|
-
obj
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def self.get_currency_decimal(currency)
|
63
|
-
return 0 if currency&.downcase == 'jpy'
|
64
|
-
|
65
|
-
2 end
|
66
|
-
end
|
67
|
-
end
|