class Tree

Tree class create array of all root directories

Attributes

directories[R]
files[R]
path_array[R]
root[R]
tree_data[R]

Public Class Methods

new(path = Dir.pwd) click to toggle source
# File lib/tree.rb, line 15
def initialize(path = Dir.pwd)
  @root = path
  @directories = 0
  @files = 0
  @tree_data = []
  @path_array = []
end

Public Instance Methods

run() click to toggle source
# File lib/tree.rb, line 23
def run
  @root = Pathname.new(@root)
  @root.each_child do |dir|
    @path_array << dir
    @tree_data << dir
  end
end
run_results() click to toggle source
# File lib/tree.rb, line 31
def run_results
  [@path_array, @directories, @files, @tree_data, @root]
end