Class: Axn::Internal::SubfieldTree::ResolvedPath
- Inherits:
-
Data
- Object
- Data
- Axn::Internal::SubfieldTree::ResolvedPath
- Defined in:
- lib/axn/internal/subfield_tree.rb
Overview
A config's resolved position in the tree, recorded once at build so runtime consumers never
re-split on: strings or re-resolve reader aliases. node is the config's leaf Node;
wire_path is the full provided_data lookup path ([top-level wire key, *wire segments]);
ancestors is the hop chain ([Node, wire segment] pairs, outermost first — each hop's node is
the parent the segment is read from), so canonical parent resolution (resolve_parent) can walk
each hop through its own reader and reflection can reason about each intermediate node's
declared type. parent_index is the chain index of the on: TARGET node (the value the
config's own field is extracted from), which canonical parent resolution resolves through the
deepest reader-bearing ancestor. A top-level config is the depth-0 case: wire_path is just
[field], ancestors are empty, parent_index 0.
Instance Attribute Summary collapse
-
#ancestors ⇒ Object
readonly
Returns the value of attribute ancestors.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#parent_index ⇒ Object
readonly
Returns the value of attribute parent_index.
-
#wire_path ⇒ Object
readonly
Returns the value of attribute wire_path.
Instance Method Summary collapse
-
#parent_node ⇒ Object
The
on:-target Node (the config's immediate parent in contract terms).
Instance Attribute Details
#ancestors ⇒ Object (readonly)
Returns the value of attribute ancestors
36 37 38 |
# File 'lib/axn/internal/subfield_tree.rb', line 36 def ancestors @ancestors end |
#node ⇒ Object (readonly)
Returns the value of attribute node
36 37 38 |
# File 'lib/axn/internal/subfield_tree.rb', line 36 def node @node end |
#parent_index ⇒ Object (readonly)
Returns the value of attribute parent_index
36 37 38 |
# File 'lib/axn/internal/subfield_tree.rb', line 36 def parent_index @parent_index end |
#wire_path ⇒ Object (readonly)
Returns the value of attribute wire_path
36 37 38 |
# File 'lib/axn/internal/subfield_tree.rb', line 36 def wire_path @wire_path end |
Instance Method Details
#parent_node ⇒ Object
The on:-target Node (the config's immediate parent in contract terms). A field name is a
single wire key, so the leaf sits DIRECTLY under this node — it is also the leaf's wire parent,
and its wire key is config.field.
40 |
# File 'lib/axn/internal/subfield_tree.rb', line 40 def parent_node = ancestors[parent_index].first |