Class: Fog::GoGrid::Compute::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/compute/go_grid.rb,
lib/fog/compute/requests/go_grid/grid_image_get.rb,
lib/fog/compute/requests/go_grid/grid_image_list.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/fog/compute/go_grid.rb', line 45

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

  @go_grid_api_key = options[:go_grid_api_key]
  @go_grid_shared_secret = options[:go_grid_shared_secret]
  @data = self.class.data[@go_grid_api_key]
end

Class Method Details

.dataObject



33
34
35
36
37
# File 'lib/fog/compute/go_grid.rb', line 33

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

.reset_data(keys = data.keys) ⇒ Object



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

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

Instance Method Details

#grid_image_get(options = {}) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/fog/compute/requests/go_grid/grid_image_get.rb', line 29

def grid_image_get(options={})
  #response = Excon::Response.new

  #images = @data[:list].values
  #for image in images
  #  case image['state']
  #  when 'Available'
end

#grid_image_list(options = {}) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/fog/compute/requests/go_grid/grid_image_list.rb', line 32

def grid_image_list(options={})
  #response = Excon::Response.new

  #images = @data[:list].values
  #for image in images
  #  case image['state']
  #  when 'Available'
end