Class: Based::SubDirectory

Inherits:
Directory show all
Defined in:
lib/based.rb

Overview

An object representing a sub-directory (i.e. not the base directory itself)

Instance Attribute Summary

Attributes inherited from Directory

#base, #fullPath, #name, #parent, #pathElements, #relativePath

Instance Method Summary collapse

Methods inherited from Directory

#allFiles, #dirs, #files, #getEntries, #subDirs

Constructor Details

#initialize(name, parent) ⇒ SubDirectory

Construct directory object from parent directory object and this directory’s name



104
105
106
107
108
109
110
111
112
# File 'lib/based.rb', line 104

def initialize(name, parent)
  super()
  @name = name
  @parent = parent
  @base = @parent.base
  @relativePath = @parent.relativePath + @name + "/"
  @pathElements = @parent.pathElements + [name]
  @fullPath = @parent.fullPath + @name + "/"
end