Class: FileSystem::DirAdapter

Inherits:
Object
  • Object
show all
Extended by:
Adapter
Includes:
Adapter
Defined in:
lib/filesystem.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Adapter

get_node, method_missing, respond_to?

Constructor Details

#initialize(dirname) ⇒ DirAdapter

Returns a new instance of 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