Class: TreeRb::ContentDir

Inherits:
Object
  • Object
show all
Defined in:
lib/tree_rb/visitors_file_system/build_dir_tree_visitor.rb

Overview

contains information related to directory (TreeNode)

Instance Method Summary collapse

Constructor Details

#initialize(pathname, options) ⇒ ContentDir

Returns a new instance of ContentDir.



8
9
10
11
12
13
14
# File 'lib/tree_rb/visitors_file_system/build_dir_tree_visitor.rb', line 8

def initialize(pathname, options)
  if options[:show_full_path]
    @contents = pathname
  else
    @contents = File.basename(pathname)
  end
end

Instance Method Details

#to_strObject



16
17
18
# File 'lib/tree_rb/visitors_file_system/build_dir_tree_visitor.rb', line 16

def to_str
  @contents
end