Class: Fog::Rackspace::CDN::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/cdn/rackspace.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/fog/cdn/rackspace.rb', line 25

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

  @rackspace_username = options[:rackspace_username]
  reset_data
end

Class Method Details

.dataObject



19
20
21
22
23
# File 'lib/fog/cdn/rackspace.rb', line 19

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

Instance Method Details

#reset_dataObject



37
38
39
40
# File 'lib/fog/cdn/rackspace.rb', line 37

def reset_data
  self.class.data.delete(@rackspace_username)
  @data = self.class.data[@rackspace_username]
end