Class: DirTree

Inherits:
Object
  • Object
show all
Includes:
Config
Defined in:
lib/cpp_dependency_graph/dir_tree.rb

Overview

Returns a root directory as a tree of directories

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Config

#source_file_extensions

Constructor Details

#initialize(path) ⇒ DirTree

Returns a new instance of DirTree.



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

def initialize(path)
  @tree ||= File.directory?(path) ? parse_dirs(path) : {}
end

Instance Attribute Details

#treeObject (readonly)

Returns the value of attribute tree.



11
12
13
# File 'lib/cpp_dependency_graph/dir_tree.rb', line 11

def tree
  @tree
end