Class: Fog::Slicehost::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/slicehost.rb,
lib/fog/slicehost/models/images.rb,
lib/fog/slicehost/models/flavors.rb,
lib/fog/slicehost/models/servers.rb,
lib/fog/slicehost/requests/get_image.rb,
lib/fog/slicehost/requests/get_slice.rb,
lib/fog/slicehost/requests/get_flavor.rb,
lib/fog/slicehost/requests/get_images.rb,
lib/fog/slicehost/requests/get_slices.rb,
lib/fog/slicehost/requests/get_backups.rb,
lib/fog/slicehost/requests/get_flavors.rb,
lib/fog/slicehost/requests/create_slice.rb,
lib/fog/slicehost/requests/delete_slice.rb,
lib/fog/slicehost/requests/reboot_slice.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.


51
52
53
54
# File 'lib/fog/slicehost.rb', line 51

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

Class Method Details

.dataObject


39
40
41
42
43
# File 'lib/fog/slicehost.rb', line 39

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

.reset_data(keys = data.keys) ⇒ Object


45
46
47
48
49
# File 'lib/fog/slicehost.rb', line 45

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

Instance Method Details

#create_slice(flavor_id, image_id, name) ⇒ Object

Raises:


41
42
43
# File 'lib/fog/slicehost/requests/create_slice.rb', line 41

def create_slice(flavor_id, image_id, name)
  raise MockNotImplemented.new("Contributions welcome!")
end

#delete_slice(slice_id) ⇒ Object

Raises:


37
38
39
# File 'lib/fog/slicehost/requests/delete_slice.rb', line 37

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

#flavorsObject


8
9
10
# File 'lib/fog/slicehost/models/flavors.rb', line 8

def flavors
  Fog::Slicehost::Flavors.new(:connection => self)
end

#get_backupsObject

Raises:


29
30
31
# File 'lib/fog/slicehost/requests/get_backups.rb', line 29

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

#get_flavor(flavor_id) ⇒ Object

Raises:


32
33
34
# File 'lib/fog/slicehost/requests/get_flavor.rb', line 32

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

#get_flavorsObject

Raises:


29
30
31
# File 'lib/fog/slicehost/requests/get_flavors.rb', line 29

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

#get_image(image_id) ⇒ Object

Raises:


30
31
32
# File 'lib/fog/slicehost/requests/get_image.rb', line 30

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

#get_imagesObject

Raises:


27
28
29
# File 'lib/fog/slicehost/requests/get_images.rb', line 27

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

#get_slice(id) ⇒ Object

Raises:


38
39
40
# File 'lib/fog/slicehost/requests/get_slice.rb', line 38

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

#get_slicesObject

Raises:


35
36
37
# File 'lib/fog/slicehost/requests/get_slices.rb', line 35

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

#images(attributes = {}) ⇒ Object


8
9
10
11
12
# File 'lib/fog/slicehost/models/images.rb', line 8

def images(attributes = {})
  Fog::Slicehost::Images.new({
    :connection => self
  }.merge!(attributes))
end

#serversObject


8
9
10
# File 'lib/fog/slicehost/models/servers.rb', line 8

def servers
  Fog::Slicehost::Servers.new(:connection => self)
end