Class: Fog::Local::Storage::Mock
- Inherits:
-
Object
- Object
- Fog::Local::Storage::Mock
- Defined in:
- lib/fog/storage/local.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#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.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/storage/local.rb', line 22 def initialize(={}) Fog::Mock.not_implemented require 'mime/types' unless .delete(:provider) location = caller.first warning = "[yellow][WARN] Fog::Local::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Local') instead[/]" warning << " [light_black](" << location << ")[/] " Formatador.display_line(warning) end @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/storage/local.rb', line 16 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
Instance Method Details
#local_root ⇒ Object
37 38 39 |
# File 'lib/fog/storage/local.rb', line 37 def local_root @local_root end |
#path_to(partial) ⇒ Object
41 42 43 |
# File 'lib/fog/storage/local.rb', line 41 def path_to(partial) ::File.join(@local_root, partial) end |
#reset_data ⇒ Object
45 46 47 48 |
# File 'lib/fog/storage/local.rb', line 45 def reset_data self.class.data.delete(@local_root) @data = self.class.data[@local_root] end |