Class: TestFs::RootDirectory
- Defined in:
- lib/test_fs/root_directory.rb
Overview
RootDirectory
Represents the root of the filesystem
Instance Attribute Summary
Attributes inherited from Directory
Instance Method Summary collapse
-
#destroy! ⇒ Object
TODO: clear lists & value for root? Recursively destroy the root filesystem.
-
#initialize ⇒ RootDirectory
constructor
A new instance of RootDirectory.
-
#path ⇒ Object
Retrieve the path for the generated root directory.
Methods inherited from Directory
Constructor Details
#initialize ⇒ RootDirectory
Returns a new instance of RootDirectory.
9 10 11 |
# File 'lib/test_fs/root_directory.rb', line 9 def initialize @nodes = [] end |
Instance Method Details
#destroy! ⇒ Object
TODO: clear lists & value for root? Recursively destroy the root filesystem
22 23 24 |
# File 'lib/test_fs/root_directory.rb', line 22 def destroy! FileUtils.rm_rf(self.path) end |
#path ⇒ Object
Retrieve the path for the generated root directory
15 16 17 |
# File 'lib/test_fs/root_directory.rb', line 15 def path "#{Dir.tmpdir}/#{name}" end |