Class: Lutaml::Model::Serialize::DeserializationContext
- Inherits:
-
Object
- Object
- Lutaml::Model::Serialize::DeserializationContext
- Defined in:
- lib/lutaml/model/serialize/deserialization_context.rb
Overview
Encapsulates the parent-to-child options propagation contract.
During deserialization, a parent passes context to its children via an options Hash. Only certain keys are safe to propagate — parent-internal keys (resolved_type, namespace_uri, converted) must be stripped so children derive their own context.
This class is the single source of truth for which keys propagate, replacing scattered CHILD_PROPAGATION_KEYS constants and ad-hoc ‘.slice` calls.
Usage:
= DeserializationContext.propagate().merge(register: register)
klass.apply_mappings(value, format, )
Constant Summary collapse
- PROPAGATION_KEYS =
Keys that are safe to propagate from parent to child deserialization.
Parent-internal keys (namespace_uri, resolved_type, converted, mappings) are intentionally excluded — children must derive their own context.
%i[ lutaml_parent lutaml_root default_namespace import_declaration_plan polymorphic collection render_empty render_nil cdata ].freeze
Class Method Summary collapse
-
.propagate(options) ⇒ Hash
Extract propagable keys from a parent options hash.
Class Method Details
.propagate(options) ⇒ Hash
Extract propagable keys from a parent options hash.
Returns a new Hash containing only the keys safe for child deserialization. Parent-internal keys are excluded.
44 45 46 |
# File 'lib/lutaml/model/serialize/deserialization_context.rb', line 44 def self.propagate() .slice(*PROPAGATION_KEYS) end |