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

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



42
43
44
45
# File 'lib/fog/go_grid/compute.rb', line 42

def initialize(options={})
  @go_grid_api_key = options[:go_grid_api_key]
  @go_grid_shared_secret = options[:go_grid_shared_secret]
end

Class Method Details

.dataObject



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

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

.resetObject



38
39
40
# File 'lib/fog/go_grid/compute.rb', line 38

def self.reset
  @data = nil
end

Instance Method Details

#dataObject



47
48
49
# File 'lib/fog/go_grid/compute.rb', line 47

def data
  self.class.data[@go_grid_api_key]
end

#grid_image_get(options = {}) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/go_grid/requests/compute/grid_image_get.rb', line 26

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

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

#grid_image_list(options = {}) ⇒ Object



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

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

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

#reset_dataObject



51
52
53
# File 'lib/fog/go_grid/compute.rb', line 51

def reset_data
  self.class.data.delete(@go_grid_api_key)
end