Method: LazyGraph::StackPointer#ptr_at
- Defined in:
- lib/lazy_graph/stack_pointer.rb
#ptr_at(index) ⇒ Object
Retrieves the StackPointer at a specific index in the upward chain of parents.
32 33 34 35 |
# File 'lib/lazy_graph/stack_pointer.rb', line 32 def ptr_at(index) @pointer_cache ||= {}.compare_by_identity @pointer_cache[index] ||= depth == index ? self : parent&.ptr_at(index) end |