Class: Fog::Local::Mock
- Inherits:
-
Object
- Object
- Fog::Local::Mock
- Defined in:
- lib/fog/local.rb,
lib/fog/local/models/directories.rb
Class Method Summary collapse
Instance Method Summary collapse
- #directories ⇒ Object
-
#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.
42 43 44 45 |
# File 'lib/fog/local.rb', line 42 def initialize(={}) @local_root = ::File.([:local_root]) @data = self.class.data[@local_root] end |
Class Method Details
.data ⇒ Object
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
#directories ⇒ Object
14 15 16 |
# File 'lib/fog/local/models/directories.rb', line 14 def directories Fog::Local::Directories.new(:connection => self) end |
#local_root ⇒ Object
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 |