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

Inherits:
Object
  • Object
show all
Defined in:
lib/rackspace-fog/go_grid/compute.rb,
lib/rackspace-fog/go_grid/requests/compute/grid_image_get.rb,
lib/rackspace-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.



45
46
47
48
# File 'lib/rackspace-fog/go_grid/compute.rb', line 45

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



35
36
37
38
39
# File 'lib/rackspace-fog/go_grid/compute.rb', line 35

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

.resetObject



41
42
43
# File 'lib/rackspace-fog/go_grid/compute.rb', line 41

def self.reset
  @data = nil
end

Instance Method Details

#dataObject



50
51
52
# File 'lib/rackspace-fog/go_grid/compute.rb', line 50

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

#grid_image_get(options = {}) ⇒ Object



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

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



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

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



54
55
56
# File 'lib/rackspace-fog/go_grid/compute.rb', line 54

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