Class: Fog::Compute::Cloudstack::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/cloudstack/compute.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



121
122
123
# File 'lib/fog/cloudstack/compute.rb', line 121

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

Class Method Details

.dataObject



111
112
113
114
115
# File 'lib/fog/cloudstack/compute.rb', line 111

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

.resetObject



117
118
119
# File 'lib/fog/cloudstack/compute.rb', line 117

def self.reset
  @data = nil
end

Instance Method Details

#dataObject



125
126
127
# File 'lib/fog/cloudstack/compute.rb', line 125

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

#reset_dataObject



129
130
131
# File 'lib/fog/cloudstack/compute.rb', line 129

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