Module: Psych::Merge::NodeTypeNormalizer
- Extended by:
- Ast::Merge::NodeTyping::Normalizer
- Defined in:
- lib/psych/merge/node_type_normalizer.rb
Overview
Normalizes backend-specific node types to canonical YAML types.
Uses Ast::Merge::NodeTyping::Wrapper to wrap nodes with canonical merge_type, allowing portable merge rules across backends.
Thread Safety
All backend registration and lookup operations are thread-safe via the shared Ast::Merge::NodeTyping::Normalizer module.
Backends
Currently supports:
:psych- Ruby's built-in Psych YAML parser (via TreeHaver Psych backend)
Extensibility
New backends can be registered at runtime:
Canonical Types
The following canonical types are used for portable merge rules:
Document Structure
:stream- Root stream node (may contain multiple documents):document- A single YAML document
Collection Types
:mapping- YAML mapping (hash/object):sequence- YAML sequence (array/list)
Scalar/Reference Types
:scalar- YAML scalar (string, number, boolean, null):alias- YAML alias (reference to an anchor)