Class: Fog::Local::Mock
- Inherits:
-
Object
- Object
- Fog::Local::Mock
- Includes:
- Collections
- Defined in:
- lib/fog/local.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #local_root ⇒ Object
- #path(partial) ⇒ Object
Methods included from Collections
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
28 29 30 31 |
# File 'lib/fog/local.rb', line 28 def initialize(={}) @local_root = ::File.([:local_root]) @data = self.class.data[@local_root] end |
Class Method Details
.data ⇒ Object
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_root ⇒ Object
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 |