lutaml-model 0.8.148 → 0.8.149
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/lutaml/model/serialize/initialization.rb +20 -2
- data/lib/lutaml/model/serialize.rb +19 -0
- data/lib/lutaml/model/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '05094b330515b62b69ce8a2576cdf74b7e5441358210ef20191d5e1ee6eca0fd'
|
|
4
|
+
data.tar.gz: 1a97398db1d90288bd121c355136e64e1d68df8d5c93dfc7a2d4812da062b538
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad0eb3a038d4a6f380ccae5336187ca306b253a4708163c76ec2296e82b6605200f1eb91760f6333381c78a0ee260b7013137f2ffdfce6cc9015097931eadb78
|
|
7
|
+
data.tar.gz: 5381dfdafa4829d1ef964d94cfdeb3c9ce4c895f2eba6fa5d84a74ee20a3ec2ae6f1ff0dbab387dd220b405f180bfa1abcc2663e7ca41d8235da96a82280752c
|
|
@@ -566,8 +566,26 @@ module Lutaml
|
|
|
566
566
|
# defaults would otherwise count as set and a render_default:
|
|
567
567
|
# false element would be written back out.
|
|
568
568
|
if constructs_through_initialize?
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
# (#1059) Run the custom initialize against COMPILED
|
|
570
|
+
# constructor-equivalent state — the walk seed (defaults
|
|
571
|
+
# resolved, non-defaulted attributes nil), not the
|
|
572
|
+
# deserialization seed: constructor bodies branch on
|
|
573
|
+
# truthiness and is_a? checks of plain state, and an
|
|
574
|
+
# UninitializedClass sentinel is truthy, so seeding
|
|
575
|
+
# sentinels here would misfire every convenience-conversion
|
|
576
|
+
# branch (uniword's convert_flat_attributes! constructed
|
|
577
|
+
# wrapper objects per node). The generic attribute walk is
|
|
578
|
+
# still stood down for the run — it would only re-materialize
|
|
579
|
+
# the same defaults the seed already wrote — and #922's
|
|
580
|
+
# finalize then resets attribute state to the deserialization
|
|
581
|
+
# markers, so constructor-seeded defaults do not count as
|
|
582
|
+
# set, exactly as before.
|
|
583
|
+
instance = allocate
|
|
584
|
+
instance.init_walk_state(register_id)
|
|
585
|
+
instance.lutaml_constructor_seeded = true
|
|
586
|
+
instance.send(:initialize)
|
|
587
|
+
instance.lutaml_constructor_seeded = nil
|
|
588
|
+
instance.finalize_deserialization(register_id)
|
|
571
589
|
return instance
|
|
572
590
|
end
|
|
573
591
|
instance = allocate
|
|
@@ -154,7 +154,26 @@ module Lutaml
|
|
|
154
154
|
|
|
155
155
|
attr_accessor :lutaml_register, :lutaml_parent, :lutaml_root
|
|
156
156
|
|
|
157
|
+
# Internal deserialization state (#1059): the XML constructor path
|
|
158
|
+
# seeds constructor-equivalent compiled state, runs the user
|
|
159
|
+
# initialize, and only then resets attribute state to the
|
|
160
|
+
# deserialization markers (#922). While the flag is set,
|
|
161
|
+
# #initialize stands down — its generic attribute walk would only
|
|
162
|
+
# re-materialize defaults that the post-run reset discards.
|
|
163
|
+
attr_accessor :lutaml_constructor_seeded
|
|
164
|
+
|
|
157
165
|
def initialize(attrs = {}, options = {})
|
|
166
|
+
if lutaml_constructor_seeded
|
|
167
|
+
# The deserialization constructor seeded constructor-equivalent
|
|
168
|
+
# compiled state (defaults resolved, non-defaulted nil) and
|
|
169
|
+
# resets attribute state after this initialize returns; the
|
|
170
|
+
# generic attribute walk here would only materialize defaults
|
|
171
|
+
# that the reset then discards (#922). This IS the custom
|
|
172
|
+
# initialize's super call — the body above us has already run
|
|
173
|
+
# against that state.
|
|
174
|
+
return
|
|
175
|
+
end
|
|
176
|
+
|
|
158
177
|
@using_default = {}
|
|
159
178
|
@lutaml_register = extract_register_id(attrs, options)
|
|
160
179
|
return unless self.class.attributes(@lutaml_register)
|
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.8.
|
|
4
|
+
version: 0.8.149
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|