From f187fd6cf8ee8cbc6fdc0436f6d3ee4d154e0745 Mon Sep 17 00:00:00 2001 From: Adrien Date: Fri, 21 Aug 2015 21:36:12 +0200 Subject: [PATCH] Add parent method to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 341d1a9..2afc0f2 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,9 @@ siblings_of_child1 = child1.siblings # ..... Retrieve immediate children of the root node as an array. children_of_root = root_node.children +# ..... Retrieve the parent of a node. +parent = child1.parent + # ..... This is a depth-first and L-to-R pre-ordered traversal. root_node.each { |node| node.content.reverse }