Class: Fog::Rackspace::Storage::Mock

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/fog/storage/rackspace.rb,
lib/fog/storage/requests/rackspace/get_object.rb,
lib/fog/storage/requests/rackspace/put_object.rb,
lib/fog/storage/requests/rackspace/head_object.rb,
lib/fog/storage/requests/rackspace/delete_object.rb,
lib/fog/storage/requests/rackspace/get_container.rb,
lib/fog/storage/requests/rackspace/put_container.rb,
lib/fog/storage/requests/rackspace/get_containers.rb,
lib/fog/storage/requests/rackspace/head_container.rb,
lib/fog/storage/requests/rackspace/head_containers.rb,
lib/fog/storage/requests/rackspace/delete_container.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

#cdn, #parse_data

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/fog/storage/rackspace.rb', line 91

def initialize(options={})
  unless options.delete(:provider)
    location = caller.first
    warning = "[yellow][WARN] Fog::Rackspace::Storage.new is deprecated, use Fog::Storage.new(:provider => 'Rackspace') instead[/]"
    warning << " [light_black](" << location << ")[/] "
    Formatador.display_line(warning)
  end

  require 'mime/types'
  @rackspace_api_key = options[:rackspace_api_key]
  @rackspace_username = options[:rackspace_username]
  @data = self.class.data[@rackspace_username]
end

Class Method Details

.dataObject



79
80
81
82
83
# File 'lib/fog/storage/rackspace.rb', line 79

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

.reset_data(keys = data.keys) ⇒ Object



85
86
87
88
89
# File 'lib/fog/storage/rackspace.rb', line 85

def self.reset_data(keys=data.keys)
  for key in [*keys]
    data.delete(key)
  end
end

Instance Method Details

#delete_container(name) ⇒ Object



24
25
26
# File 'lib/fog/storage/requests/rackspace/delete_container.rb', line 24

def delete_container(name)
  Fog::Mock.not_implemented
end

#delete_object(container, object) ⇒ Object



25
26
27
# File 'lib/fog/storage/requests/rackspace/delete_object.rb', line 25

def delete_object(container, object)
  Fog::Mock.not_implemented
end

#get_container(container, options = {}) ⇒ Object



45
46
47
# File 'lib/fog/storage/requests/rackspace/get_container.rb', line 45

def get_container(container, options = {})
  Fog::Mock.not_implemented
end

#get_containers(options = {}) ⇒ Object



34
35
36
# File 'lib/fog/storage/requests/rackspace/get_containers.rb', line 34

def get_containers(options = {})
  Fog::Mock.not_implemented
end

#get_object(container, object, &block) ⇒ Object



26
27
28
# File 'lib/fog/storage/requests/rackspace/get_object.rb', line 26

def get_object(container, object, &block)
  Fog::Mock.not_implemented
end

#head_container(container) ⇒ Object



30
31
32
# File 'lib/fog/storage/requests/rackspace/head_container.rb', line 30

def head_container(container)
  Fog::Mock.not_implemented
end

#head_containersObject



27
28
29
# File 'lib/fog/storage/requests/rackspace/head_containers.rb', line 27

def head_containers
  Fog::Mock.not_implemented
end

#head_object(container, object) ⇒ Object



25
26
27
# File 'lib/fog/storage/requests/rackspace/head_object.rb', line 25

def head_object(container, object)
  Fog::Mock.not_implemented
end

#put_container(name) ⇒ Object



24
25
26
# File 'lib/fog/storage/requests/rackspace/put_container.rb', line 24

def put_container(name)
  Fog::Mock.not_implemented
end

#put_object(container, object, data, options = {}) ⇒ Object



28
29
30
# File 'lib/fog/storage/requests/rackspace/put_object.rb', line 28

def put_object(container, object, data, options = {})
  Fog::Mock.not_implemented
end