Class: IncludeFileDependencyGraph
- Inherits:
-
Object
- Object
- IncludeFileDependencyGraph
- Defined in:
- lib/cpp_dependency_graph/include_file_dependency_graph.rb
Overview
Returns a hash of individual file include links
Instance Method Summary collapse
- #all_cyclic_links ⇒ Object
-
#initialize(project) ⇒ IncludeFileDependencyGraph
constructor
A new instance of IncludeFileDependencyGraph.
- #links(file_name) ⇒ Object
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
#all_cyclic_links ⇒ Object
13 14 15 |
# File 'lib/cpp_dependency_graph/include_file_dependency_graph.rb', line 13 def all_cyclic_links # TODO: Implement end |
#links(file_name) ⇒ Object
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 |