Class: TTY::Tree::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/gzr/commands/folder/tree.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, parent, prefix, level) ⇒ Node

Returns a new instance of Node.



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/gzr/commands/folder/tree.rb', line 36

def initialize(path, parent, prefix, level)
  if path.is_a? String
    # strip null bytes from the string to avoid throwing errors
    path = path.delete("\0")
  end

  @path = path
  @name   = path
  @parent = parent
  @prefix = prefix
  @level  = level
end