Class: Fog::Backblaze::Storage::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/backblaze/storage/mock.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.


12
13
14
15
16
17
# File 'lib/fog/backblaze/storage/mock.rb', line 12

def initialize(options={})
  @b2_account_id = options[:b2_account_id]
  @b2_account_token = options[:b2_account_token]
  @path = '/v1/AUTH_1234'
  @containers = {}
end

Class Method Details

.dataObject


2
3
4
5
6
# File 'lib/fog/backblaze/storage/mock.rb', line 2

def self.data
  @data ||= Hash.new do |hash, key|
    hash[key] = {}
  end
end

.resetObject


8
9
10
# File 'lib/fog/backblaze/storage/mock.rb', line 8

def self.reset
  @data = nil
end

Instance Method Details

#change_account(account) ⇒ Object


27
28
29
30
31
# File 'lib/fog/backblaze/storage/mock.rb', line 27

def ()
  @original_path ||= @path
  version_string = @original_path.split('/')[1]
  @path = "/#{version_string}/#{}"
end

#dataObject


19
20
21
# File 'lib/fog/backblaze/storage/mock.rb', line 19

def data
  self.class.data[@softlayer_username]
end

#reset_account_nameObject


33
34
35
# File 'lib/fog/backblaze/storage/mock.rb', line 33

def 
  @path = @original_path
end

#reset_dataObject


23
24
25
# File 'lib/fog/backblaze/storage/mock.rb', line 23

def reset_data
  self.class.data.delete(@softlayer_username)
end