finapps_core 5.0.0 → 5.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dced1728081e6bccc330d81b3ad5747e7b8965fce107a23fe8c35054c14cf5b
|
4
|
+
data.tar.gz: 1ef25f396d5d56fff7da505285a7bb690c493d2d0bb06a7e8b86e4d372a80898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d878ee1f66386490a43e3643eb6a033c0359db022de62280e4f77e535683c6ecfd2759b64702a9e0cc04d49f5486c5134686d6a1f630dd7b3752617d24682b8
|
7
|
+
data.tar.gz: 8219da9b55aa714a0b6f92122d7c1b0297e77dfb6829a91bef982c4cbd6af61bcf9dfaf45217feb91145fa445a731fb462088dd93e92bb72bb8b7b98469ad063
|
@@ -43,15 +43,15 @@ module FinAppsCore
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def messages(hash)
|
46
|
-
return nil unless hash.respond_to?(:key?) && hash.key?(
|
46
|
+
return nil unless hash.respond_to?(:key?) && hash.key?(:messages)
|
47
47
|
|
48
|
-
hash[
|
48
|
+
hash[:messages]
|
49
49
|
end
|
50
50
|
|
51
51
|
def to_hash(source)
|
52
52
|
return source unless source.is_a?(String)
|
53
53
|
|
54
|
-
source.json_to_hash
|
54
|
+
symbolize(source.json_to_hash)
|
55
55
|
end
|
56
56
|
|
57
57
|
def empty?(obj)
|
@@ -61,6 +61,13 @@ module FinAppsCore
|
|
61
61
|
def user_is_locked?(env)
|
62
62
|
env.status == FORBIDDEN && error_messages(env.body)&.[](0)&.downcase == LOCKOUT_MESSAGE
|
63
63
|
end
|
64
|
+
|
65
|
+
def symbolize(obj)
|
66
|
+
return obj.each_with_object({}) {|(k, v), memo| memo[k.to_sym] = symbolize(v); } if obj.is_a? Hash
|
67
|
+
return obj.each_with_object([]) {|v, memo| memo << symbolize(v); } if obj.is_a? Array
|
68
|
+
|
69
|
+
obj
|
70
|
+
end
|
64
71
|
end
|
65
72
|
end
|
66
73
|
end
|
@@ -22,8 +22,9 @@ module FinAppsCore
|
|
22
22
|
conn.request :request_id, config.request_id if config.request_id
|
23
23
|
|
24
24
|
conn.use FinAppsCore::Middleware::RaiseError
|
25
|
-
conn.response :
|
26
|
-
|
25
|
+
conn.response :json,
|
26
|
+
content_type: /\bjson$/,
|
27
|
+
parser_options: { symbolize_names: true }
|
27
28
|
conn.response :logger, logger, bodies: true
|
28
29
|
|
29
30
|
# Adapter (ensure that the adapter is always last.)
|
data/lib/finapps_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|