istox 0.2.3.pre.2 → 0.2.3.pre.50

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: 6d1176bd57c3e5f7c3cf169446b6aec6c51d101fe1db516fa33a492319bcfd1f
4
- data.tar.gz: e6a8027c9e9f1ab224af5643209bb78165fd3686d384561a3cde9ae441fe40d7
3
+ metadata.gz: 8a37094ad3d7261ff966de95b57241e7fadd5163e4f25303b2ebcfd69f5ebc4b
4
+ data.tar.gz: 7bd37b3b0d4bb6c19d4765bf3892c8f3df0199436313d2c1ae04ba36f72e7bda
5
5
  SHA512:
6
- metadata.gz: 00f2d9c5ed2399e76cab9b940f733e862eae42b79e4de1a7bec5ba301d1240ae95d9487d6a6b68163625da306b69620f2dd926e3ba7a3b67d65a5ad2415a315c
7
- data.tar.gz: 742bd4f7b1bccc45dbf031704b1476d68fa52fc9ce68bb1d8445345d177911f9033c0d00807f9408a1cbe5b8a3ca080d529ad9b050ef76a9aeb0658682017c1a
6
+ metadata.gz: b79144b9db5b31db8bcdc18f9b6d3abf27115c1ee110c308b0bd2cea4ac07d4a992df03b88234eb30fc299746bcfebb360521c096bb6a198164a36920e05cd5a
7
+ data.tar.gz: dcd974e74516be719fbccba077de410935140b213cabe31a9266c2261df84c358f14a87f4ae2a650f892be83249f98dcf89515dee53489f83989ecefc86db016
data/.gitignore CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
data/.solargraph.yml CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.2.3.pre.2)
4
+ istox (0.2.3.pre.1)
5
5
  amazing_print
6
6
  awesome_print
7
7
  aws-sdk-sns (~> 1)
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
@@ -0,0 +1,67 @@
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
File without changes
File without changes
File without changes
@@ -131,7 +131,7 @@ module Istox
131
131
  next unless ce.present?
132
132
 
133
133
  copy_email_data = email_data.clone
134
-
134
+ log.info "Checking copy email data #{copy_email_data.inspect}"
135
135
  # if it is just email to cc
136
136
  if ce.is_a? String
137
137
  copy_email_data[:email] = ce
@@ -148,8 +148,10 @@ module Istox
148
148
  next unless ce[:email].present?
149
149
 
150
150
  copy_email_data[:email] = ce[:email]
151
- copy_email_data[:sid] = ce[:sid]
152
- copy_email_data = copy_email_data.merge(ce[:params]) if ce[:params].present?
151
+ log.info "Checking copy email data after assigning #{copy_email_data.inspect}"
152
+ log.info "Checking ce #{ce[:params].inspect}"
153
+
154
+ copy_email_data = copy_email_data.merge(ce[:params])
153
155
  end
154
156
 
155
157
  copy_email_data.delete(:copy_emails)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.2.3-2'.freeze
2
+ VERSION = '0.2.3-50'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3.pre.2
4
+ version: 0.2.3.pre.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-30 00:00:00.000000000 Z
11
+ date: 2021-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print
@@ -494,6 +494,7 @@ 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
497
498
  - lib/istox/helpers/blockchain_service.rb
498
499
  - lib/istox/helpers/bunny_boot.rb
499
500
  - lib/istox/helpers/common_helper.rb
@@ -546,7 +547,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
546
547
  - !ruby/object:Gem::Version
547
548
  version: 1.3.1
548
549
  requirements: []
549
- rubygems_version: 3.0.6
550
+ rubygems_version: 3.2.11
550
551
  signing_key:
551
552
  specification_version: 4
552
553
  summary: istox backend shared gem