Method: Hanuman::GraphInstanceMethods#ancestors

Defined in:
lib/hanuman/graph.rb

#ancestors(stage = nil) ⇒ Object



14
15
16
17
18
# File 'lib/hanuman/graph.rb', line 14

def ancestors stage=nil
  links.find_all do |link|
    stage ? link.into == stage.label : true
  end.map(&:from).uniq.map { |label| stages[label] }.compact
end