Class: Depdump::DependencyGraph::Formatter::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/depdump/dependency_graph.rb

Instance Method Summary collapse

Instance Method Details

#call(nodes, edges) ⇒ Object



36
37
38
39
40
41
# File 'lib/depdump/dependency_graph.rb', line 36

def call(nodes, edges)
  JSON.dump({
    nodes: nodes.map(&:namespaces),
    edges: edges.to_a,
  })
end