Class: Fog::Rackspace::Files::Mock

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.


68
69
70
71
# File 'lib/fog/rackspace/files.rb', line 68

def initialize(options={})
  @rackspace_username = options[:rackspace_username]
  @data = self.class.data[@rackspace_username]
end

Class Method Details

.dataObject


56
57
58
59
60
# File 'lib/fog/rackspace/files.rb', line 56

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

.reset_data(keys = data.keys) ⇒ Object


62
63
64
65
66
# File 'lib/fog/rackspace/files.rb', line 62

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

Instance Method Details

#delete_container(name) ⇒ Object

Raises:


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

def delete_container(name)
  raise MockNotImplemented.new("Contributions welcome!")
end

#delete_object(container, object) ⇒ Object

Raises:


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

def delete_object(container, object)
  raise MockNotImplemented.new("Contributions welcome!")
end

#directoriesObject


15
16
17
# File 'lib/fog/rackspace/models/files/directories.rb', line 15

def directories
  Fog::Rackspace::Files::Directories.new(:connection => self)
end

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

Raises:


50
51
52
# File 'lib/fog/rackspace/requests/files/get_container.rb', line 50

def get_container(container, options = {})
  raise MockNotImplemented.new("Contributions welcome!")
end

#get_containers(options = {}) ⇒ Object

Raises:


40
41
42
# File 'lib/fog/rackspace/requests/files/get_containers.rb', line 40

def get_containers(options = {})
  raise MockNotImplemented.new("Contributions welcome!")
end

#get_object(container, object) ⇒ Object

Raises:


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

def get_object(container, object)
  raise MockNotImplemented.new("Contributions welcome!")
end

#head_container(container) ⇒ Object

Raises:


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

def head_container(container)
  raise MockNotImplemented.new("Contributions welcome!")
end

#head_containersObject

Raises:


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

def head_containers
  raise MockNotImplemented.new("Contributions welcome!")
end

#head_object(container, object) ⇒ Object

Raises:


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

def head_object(container, object)
  raise MockNotImplemented.new("Contributions welcome!")
end

#put_container(name) ⇒ Object

Raises:


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

def put_container(name)
  raise MockNotImplemented.new("Contributions welcome!")
end

#put_object(container, object, data) ⇒ Object

Raises:


27
28
29
# File 'lib/fog/rackspace/requests/files/put_object.rb', line 27

def put_object(container, object, data)
  raise MockNotImplemented.new("Contributions welcome!")
end