Method: HashTree::Node#parents

Defined in:
lib/hash_tree.rb

#parents(include_self = false) ⇒ Object

List of parents up to the root element. If include_self is true, also include self as the first element



87
88
89
# File 'lib/hash_tree.rb', line 87

def parents(include_self = false)
  (include_self ? [self] : []) + (@parents ||= (parent&.parents(true) || []))
end