Class: Mementus::Pipes::Outgoing

Inherits:
Object
  • Object
show all
Defined in:
lib/mementus/pipes/outgoing.rb

Instance Method Summary collapse

Instance Method Details

#process(graph, source) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/mementus/pipes/outgoing.rb', line 4

def process(graph, source)
  if source.respond_to?(:adjacent)
    source.adjacent
  else
    source.inject([]) do |result, node|
      result.concat(node.adjacent)
    end
  end
end