Method: Hanuman::TreeInstanceMethods#root

Defined in:
lib/hanuman/tree.rb

#root(stage = nil) ⇒ Object



23
24
25
26
27
# File 'lib/hanuman/tree.rb', line 23

def root stage=nil
  return stages[directed_sort.first] unless stage
  return stage unless ancestor(stage)
  self.root(ancestor(stage))
end