Class: Fog::Compute::Ecloud::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/rackspace-fog/ecloud/compute.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



330
331
332
# File 'lib/rackspace-fog/ecloud/compute.rb', line 330

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

Class Method Details

.dataObject



320
321
322
323
324
# File 'lib/rackspace-fog/ecloud/compute.rb', line 320

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

.resetObject



326
327
328
# File 'lib/rackspace-fog/ecloud/compute.rb', line 326

def self.reset
  @data = nil
end

Instance Method Details

#dataObject



334
335
336
# File 'lib/rackspace-fog/ecloud/compute.rb', line 334

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

#reset_dataObject



338
339
340
# File 'lib/rackspace-fog/ecloud/compute.rb', line 338

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