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