Class: Fog::Local::Mock

Inherits:
Object
  • Object
show all
Includes:
Collections
Defined in:
lib/fog/local.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Collections

#directories

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



28
29
30
31
# File 'lib/fog/local.rb', line 28

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

Class Method Details

.dataObject



16
17
18
19
20
# File 'lib/fog/local.rb', line 16

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

.reset_data(keys = data.keys) ⇒ Object



22
23
24
25
26
# File 'lib/fog/local.rb', line 22

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

Instance Method Details

#local_rootObject



33
34
35
# File 'lib/fog/local.rb', line 33

def local_root
  @local_root
end

#path(partial) ⇒ Object



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

def path(partial)
  partial
end