Class: FileSystem::DirAdapter
- Inherits:
-
Object
- Object
- FileSystem::DirAdapter
- Extended by:
- Adapter
- Includes:
- Adapter
- Defined in:
- lib/filesystem.rb
Overview
:nodoc:
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dirname) ⇒ DirAdapter
constructor
A new instance of DirAdapter.
Methods included from Adapter
get_node, method_missing, respond_to?
Constructor Details
#initialize(dirname) ⇒ DirAdapter
100 101 102 103 104 |
# File 'lib/filesystem.rb', line 100 def initialize( dirname ) unless get_node( dirname ).class == MockFileSystem::MockDir raise Errno::ENOTDIR end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FileSystem::Adapter
Class Method Details
.mkdir(dirname) ⇒ Object
95 96 97 98 |
# File 'lib/filesystem.rb', line 95 def self.mkdir( dirname ) path = Path.new( dirname ).absolute get_node( path.parent ).mkdir( path.node ) end |