wolf_core 1.0.87 → 1.0.89
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: 9e3788f54ee4bc3d7ccb0553bf1fd049dd350cd24394e30aac7857f7559a8e0b
|
4
|
+
data.tar.gz: a3a178220e9786855a088e5e3808044bb9f98d6062e4755c638c7ca1d852ba9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3656e64d8c6a45ef9b2d76701299ce37c272f01f9c7140b071aeb95e89b6c383a34f2d8d7c08b7937386eecad7a80284bf64619b5b354b4a5c1ea0414662576f
|
7
|
+
data.tar.gz: 9d268b51a5a6de04ca91a8aafbf0bef34ead641b58ea6658ebcb6043858bfe5034ff3faa3615966384b42fd0b137fbced25d88e2b24b20db18d9ba86871211df
|
@@ -48,13 +48,13 @@ module WolfCore
|
|
48
48
|
object
|
49
49
|
else
|
50
50
|
result = self.create(object)
|
51
|
-
success_key = extract_success_key
|
51
|
+
success_key = extract_success_key
|
52
52
|
result.success? ? result.data.send(success_key) : object
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
def self.create_all(objects)
|
57
|
-
success_key = extract_success_key
|
57
|
+
success_key = extract_success_key
|
58
58
|
final_array = []
|
59
59
|
objects.each do |object|
|
60
60
|
result = create(object)
|
@@ -71,7 +71,7 @@ module WolfCore
|
|
71
71
|
object = self.new(parse_params(params, **kwargs))
|
72
72
|
object.reset_changes
|
73
73
|
if object.valid?
|
74
|
-
success_key = extract_success_key
|
74
|
+
success_key = extract_success_key
|
75
75
|
Result.success(data: { success_key => object })
|
76
76
|
else
|
77
77
|
Result.failure(error: { message: object.errors.full_messages.to_sentence })
|
@@ -80,8 +80,8 @@ module WolfCore
|
|
80
80
|
Result.failure(error: { message: e.message, error_type: e.class.to_s })
|
81
81
|
end
|
82
82
|
|
83
|
-
def self.extract_success_key
|
84
|
-
|
83
|
+
def self.extract_success_key
|
84
|
+
self.to_s.split('::').last.underscore
|
85
85
|
end
|
86
86
|
|
87
87
|
def self.parse_params(params = {}, **kwargs)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module WolfCore
|
2
|
+
module Serializable
|
3
|
+
def serialize_with(serializer, entity, options = {})
|
4
|
+
serializer.new(entity, options).as_json.with_indifferent_access
|
5
|
+
end
|
6
|
+
|
7
|
+
def serialize_all_with(serializer, collection, options = {})
|
8
|
+
collection.map do |item|
|
9
|
+
serialize_with(
|
10
|
+
serializer,
|
11
|
+
item,
|
12
|
+
options
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/wolf_core/version.rb
CHANGED
data/lib/wolf_core.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wolf_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.89
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Roncallo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: active_model_serializers
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: Repository to store shared code among Ruby projects.
|
112
126
|
email:
|
113
127
|
- jroncallo96@gmail.com
|
@@ -146,6 +160,7 @@ files:
|
|
146
160
|
- lib/wolf_core/infrastructure/lambda_function_operations.rb
|
147
161
|
- lib/wolf_core/infrastructure/no_sql_db_data_source.rb
|
148
162
|
- lib/wolf_core/infrastructure/no_sql_db_operations.rb
|
163
|
+
- lib/wolf_core/infrastructure/serializable.rb
|
149
164
|
- lib/wolf_core/utils/array_utils.rb
|
150
165
|
- lib/wolf_core/utils/async_utils.rb
|
151
166
|
- lib/wolf_core/utils/file_utils.rb
|