Module: ArchUnit::GraphReporting::Projection::NodeSelection

Defined in:
lib/archunit/graph/projection/node_selection.rb

Overview

Pure graph traversal for focus, reachability, and dependent queries.

Class Method Summary collapse

Class Method Details

.select(edges, options) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/archunit/graph/projection/node_selection.rb', line 12

def select(edges, options)
  return all_nodes(edges) unless query?(options)

  selected = Set.new
  selected.merge(expand_focus(edges, options.focus, options.focus_depth)) if options.focus
  selected.merge(walk(edges, options.reachable_from, :outgoing)) if options.reachable_from
  selected.merge(walk(edges, options.dependents_of, :incoming)) if options.dependents_of
  selected
end