Class: Calcifer::Graph::RootFile

Inherits:
Object
  • Object
show all
Defined in:
lib/calcifer/graph/root_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(module_name, file) ⇒ RootFile

Returns a new instance of RootFile.



8
9
10
11
12
13
# File 'lib/calcifer/graph/root_file.rb', line 8

def initialize(module_name, file)
  @module_name = module_name
  @file = file
  @file_path = file.path
  build_graph_root
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



6
7
8
# File 'lib/calcifer/graph/root_file.rb', line 6

def file_path
  @file_path
end

#graph_rootObject (readonly)

Returns the value of attribute graph_root.



6
7
8
# File 'lib/calcifer/graph/root_file.rb', line 6

def graph_root
  @graph_root
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



6
7
8
# File 'lib/calcifer/graph/root_file.rb', line 6

def module_name
  @module_name
end

Instance Method Details



15
16
17
# File 'lib/calcifer/graph/root_file.rb', line 15

def add_related_file_path(file_path)
  @graph_root.add_edge(@file.path, file_path)
end


19
20
21
# File 'lib/calcifer/graph/root_file.rb', line 19

def related_files_paths
  @graph_root.vertices - [@file.path]
end