Class: IncludeFileDependencyGraph

Inherits:
Object
  • Object
show all
Defined in:
lib/cpp_dependency_graph/include_file_dependency_graph.rb

Overview

Returns a hash of individual file include links

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ IncludeFileDependencyGraph

Returns a new instance of IncludeFileDependencyGraph.



9
10
11
# File 'lib/cpp_dependency_graph/include_file_dependency_graph.rb', line 9

def initialize(project)
  @project = project
end

Instance Method Details



13
14
15
# File 'lib/cpp_dependency_graph/include_file_dependency_graph.rb', line 13

def all_cyclic_links
  # TODO: Implement
end


17
18
19
20
21
22
23
24
25
# File 'lib/cpp_dependency_graph/include_file_dependency_graph.rb', line 17

def links(file_name)
  files = @project.source_files.select do |_, file|
    file.includes.include?(file_name)
  end
  files.map do |_, file|
    links = [Link.new(file.basename, file_name, false)]
    [file.basename, links]
  end.to_h
end