tucana 0.0.41 → 0.0.42
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 +4 -4
- data/lib/tucana/shared/shared.data_type.rb +19 -24
- data/lib/tucana/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: add586d464b13411b6d92c081e32e4fdd378c70507025c0c36bdfc749f05fee1
|
|
4
|
+
data.tar.gz: 484c0a0e5dc2b84491666d48f30d65dbd095f7777cd501bfe084f06389b49ef8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b58936817c15d06f6b583fac36a3f98d440482c5024c9bf0ba6ccd117ff3736694410b995fa0f64193e1afdee2a33604a9ad9108b3109cbe1139f6c9f1f8d08
|
|
7
|
+
data.tar.gz: 985702518c6936fa15c18cd00db66694fa2491c31f3b318b77f8cdc2538929ddcea200edef78053eb2ac29ed03338ad944699e806e15cf47cf6630adde6e04f0
|
|
@@ -177,11 +177,13 @@ module Tucana
|
|
|
177
177
|
|
|
178
178
|
DataTypeIdentifier.class_eval do
|
|
179
179
|
def to_h
|
|
180
|
-
|
|
181
|
-
data_type_identifier: self.data_type_identifier
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
if !self.data_type_identifier.empty?
|
|
181
|
+
return { data_type_identifier: self.data_type_identifier }
|
|
182
|
+
elsif !self.generic_type.nil?
|
|
183
|
+
return { generic_type: self.generic_type.to_h }
|
|
184
|
+
elsif !self.generic_key.nil?
|
|
185
|
+
return { generic_key: self.generic_key }
|
|
186
|
+
end
|
|
185
187
|
end
|
|
186
188
|
|
|
187
189
|
def from_hash(config)
|
|
@@ -210,18 +212,18 @@ module Tucana
|
|
|
210
212
|
GenericType.class_eval do
|
|
211
213
|
def to_h
|
|
212
214
|
{
|
|
213
|
-
data_type_identifier: self.data_type_identifier
|
|
214
|
-
|
|
215
|
+
data_type_identifier: self.data_type_identifier,
|
|
216
|
+
generic_mappers: self.generic_mappers.map(&:to_h),
|
|
215
217
|
}
|
|
216
218
|
end
|
|
217
219
|
|
|
218
220
|
def from_hash(config)
|
|
219
221
|
if config.key?(:data_type_identifier)
|
|
220
|
-
self.data_type_identifier =
|
|
222
|
+
self.data_type_identifier = config.fetch(:data_type_identifier)
|
|
221
223
|
end
|
|
222
224
|
|
|
223
|
-
if config.key?(:
|
|
224
|
-
self.
|
|
225
|
+
if config.key?(:generic_mappers)
|
|
226
|
+
self.generic_mappers = config.fetch(:generic_mappers).map { |mapper_config| GenericMapper.from_hash(mapper_config) }
|
|
225
227
|
end
|
|
226
228
|
|
|
227
229
|
self
|
|
@@ -235,24 +237,17 @@ module Tucana
|
|
|
235
237
|
GenericMapper.class_eval do
|
|
236
238
|
def to_h
|
|
237
239
|
{
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
240
|
+
target: self.target,
|
|
241
|
+
source: self.source.to_h,
|
|
242
|
+
generic_combinations: self.generic_combinations.map(&:to_h),
|
|
241
243
|
}
|
|
242
244
|
end
|
|
243
245
|
|
|
244
246
|
def from_hash(config)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if config.key?(:data_type_identifier)
|
|
250
|
-
self.data_type_identifier = DataTypeIdentifier.from_hash(config.fetch(:data_type_identifier))
|
|
251
|
-
elsif config.key?(:generic_key)
|
|
252
|
-
self.generic_key = config.fetch(:generic_key)
|
|
253
|
-
end
|
|
254
|
-
|
|
255
|
-
self.source = config[:source]
|
|
247
|
+
self.target = config[:target]
|
|
248
|
+
self.source = DataTypeIdentifier.from_hash(config.fetch(:source))
|
|
249
|
+
self.generic_combinations = config.fetch(:generic_combinations, [])
|
|
250
|
+
self
|
|
256
251
|
end
|
|
257
252
|
|
|
258
253
|
def self.from_hash(config)
|
data/lib/tucana/version.rb
CHANGED