lutaml-model 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lutaml/model/attribute.rb +3 -1
- data/lib/lutaml/model/serialize.rb +10 -1
- data/lib/lutaml/model/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d57b531de09099b0f55b1891c2b0dfec1a04fa75229a40c5c6b974f3be92fcda
|
4
|
+
data.tar.gz: a893710f75fde8b5465360b95e6e772ba35711311a719ac35704a9a8ea7788ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9ef9798066d2ec69567a2cfb9277d0058b933b640df9c6c240c1010a626560c27cdd722d10a474deddf70560f902bf58d41e35d1e2d1a8aa0fe83a9451afb2a
|
7
|
+
data.tar.gz: 2c2bd13597f84afecd1aaf6fa4686db48048e371b014c55cb8c5993668eec38781e8b02ccd85a8ae5b68da8b3ea68056db87be7830128d35735c69f098711ff0
|
@@ -216,7 +216,9 @@ module Lutaml
|
|
216
216
|
serialize(v, format, options)
|
217
217
|
end
|
218
218
|
elsif type <= Serialize
|
219
|
-
|
219
|
+
if Utils.present?(value)
|
220
|
+
type.public_send(:"as_#{format}", value, options)
|
221
|
+
end
|
220
222
|
else
|
221
223
|
# Convert to Value instance if not already
|
222
224
|
value = type.new(value) unless value.is_a?(Type::Value)
|
@@ -367,7 +367,16 @@ module Lutaml
|
|
367
367
|
map_value = {}
|
368
368
|
child_mappings.each do |attr_name, path|
|
369
369
|
attr_value = child_obj.send(attr_name)
|
370
|
-
|
370
|
+
|
371
|
+
attr_value = if attr_value.is_a?(Lutaml::Model::Serialize)
|
372
|
+
attr_value.to_yaml_hash
|
373
|
+
elsif attr_value.is_a?(Array) && attr_value.first.is_a?(Lutaml::Model::Serialize)
|
374
|
+
attr_value.map(&:to_yaml_hash)
|
375
|
+
else
|
376
|
+
attr_value
|
377
|
+
end
|
378
|
+
|
379
|
+
next if Utils.blank?(attr_value)
|
371
380
|
|
372
381
|
if path == :key
|
373
382
|
map_key = attr_value
|
data/lib/lutaml/model/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lutaml-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -195,7 +195,7 @@ licenses:
|
|
195
195
|
- BSD-2-Clause
|
196
196
|
metadata:
|
197
197
|
rubygems_mfa_required: 'true'
|
198
|
-
post_install_message:
|
198
|
+
post_install_message:
|
199
199
|
rdoc_options: []
|
200
200
|
require_paths:
|
201
201
|
- lib
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
version: '0'
|
212
212
|
requirements: []
|
213
213
|
rubygems_version: 3.3.27
|
214
|
-
signing_key:
|
214
|
+
signing_key:
|
215
215
|
specification_version: 4
|
216
216
|
summary: LutaML creating data models in Ruby
|
217
217
|
test_files: []
|