Class: Fog::Local::Storage::Mock
- Inherits:
-
Object
- Object
- Fog::Local::Storage::Mock
- Defined in:
- lib/fog/local/storage.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #local_root ⇒ Object
- #path(partial) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
27 28 29 30 |
# File 'lib/fog/local/storage.rb', line 27 def initialize(={}) @local_root = ::File.([:local_root]) @data = self.class.data[@local_root] end |
Class Method Details
.data ⇒ Object
15 16 17 18 19 |
# File 'lib/fog/local/storage.rb', line 15 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
.reset_data(keys = data.keys) ⇒ Object
21 22 23 24 25 |
# File 'lib/fog/local/storage.rb', line 21 def self.reset_data(keys=data.keys) for key in [*keys] data.delete(key) end end |
Instance Method Details
#local_root ⇒ Object
32 33 34 |
# File 'lib/fog/local/storage.rb', line 32 def local_root @local_root end |
#path(partial) ⇒ Object
36 37 38 |
# File 'lib/fog/local/storage.rb', line 36 def path(partial) partial end |