Class: Fog::Local::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/local.rb,
lib/fog/local/models/directories.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



42
43
44
45
# File 'lib/fog/local.rb', line 42

def initialize(options={})
  @local_root = ::File.expand_path(options[:local_root])
  @data       = self.class.data[@local_root]
end

Class Method Details

.dataObject



30
31
32
33
34
# File 'lib/fog/local.rb', line 30

def self.data
  @data ||= Hash.new do |hash, key|
    hash[key] = {}
  end
end

.reset_data(keys = data.keys) ⇒ Object



36
37
38
39
40
# File 'lib/fog/local.rb', line 36

def self.reset_data(keys=data.keys)
  for key in [*keys]
    data.delete(key)
  end
end

Instance Method Details

#directoriesObject



14
15
16
# File 'lib/fog/local/models/directories.rb', line 14

def directories
  Fog::Local::Directories.new(:connection => self)
end

#local_rootObject



47
48
49
# File 'lib/fog/local.rb', line 47

def local_root
  @local_root
end

#path(partial) ⇒ Object



51
52
53
# File 'lib/fog/local.rb', line 51

def path(partial)
  partial
end