Class: Fog::Bluebox::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/bluebox.rb,
lib/fog/bluebox/models/images.rb,
lib/fog/bluebox/models/flavors.rb,
lib/fog/bluebox/models/servers.rb,
lib/fog/bluebox/requests/get_block.rb,
lib/fog/bluebox/requests/get_blocks.rb,
lib/fog/bluebox/requests/get_product.rb,
lib/fog/bluebox/requests/create_block.rb,
lib/fog/bluebox/requests/get_products.rb,
lib/fog/bluebox/requests/get_template.rb,
lib/fog/bluebox/requests/reboot_block.rb,
lib/fog/bluebox/requests/destroy_block.rb,
lib/fog/bluebox/requests/get_templates.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



58
59
60
61
# File 'lib/fog/bluebox.rb', line 58

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

Class Method Details

.dataObject



46
47
48
49
50
# File 'lib/fog/bluebox.rb', line 46

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

.reset_data(keys = data.keys) ⇒ Object



52
53
54
55
56
# File 'lib/fog/bluebox.rb', line 52

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

Instance Method Details

#create_block(product_id, template_id, name, password) ⇒ Object



33
34
35
# File 'lib/fog/bluebox/requests/create_block.rb', line 33

def create_block(product_id, template_id, name, password)
  Fog::Mock.not_implemented
end

#destroy_block(block_id) ⇒ Object



26
27
28
# File 'lib/fog/bluebox/requests/destroy_block.rb', line 26

def destroy_block(block_id)
  Fog::Mock.not_implemented
end

#flavorsObject



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

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

#get_product(product_id) ⇒ Object



26
27
28
# File 'lib/fog/bluebox/requests/get_product.rb', line 26

def get_product(product_id)
  Fog::Mock.not_implemented
end

#get_productsObject



25
26
27
# File 'lib/fog/bluebox/requests/get_products.rb', line 25

def get_products
  Fog::Mock.not_implemented
end

#get_slice(id) ⇒ Object



26
27
28
# File 'lib/fog/bluebox/requests/get_block.rb', line 26

def get_slice(id)
  Fog::Mock.not_implemented
end

#get_slicesObject



28
29
30
# File 'lib/fog/bluebox/requests/get_blocks.rb', line 28

def get_slices
  Fog::Mock.not_implemented
end

#get_template(template_id) ⇒ Object



26
27
28
# File 'lib/fog/bluebox/requests/get_template.rb', line 26

def get_template(template_id)
  Fog::Mock.not_implemented
end

#get_templatesObject



26
27
28
# File 'lib/fog/bluebox/requests/get_templates.rb', line 26

def get_templates
  Fog::Mock.not_implemented
end

#images(attributes = {}) ⇒ Object



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

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

#reboot_block(block_id, type = 'SOFT') ⇒ Object



27
28
29
# File 'lib/fog/bluebox/requests/reboot_block.rb', line 27

def reboot_block(block_id, type = 'SOFT')
  Fog::Mock.not_implemented
end

#serversObject



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

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