Class: TerremarkEcloud

Inherits:
Fog::Bin show all
Defined in:
lib/fog/bin/terremark_ecloud.rb

Class Method Summary collapse

Methods inherited from Fog::Bin

available?, collections

Class Method Details

.[](service) ⇒ Object



16
17
18
19
20
21
# File 'lib/fog/bin/terremark_ecloud.rb', line 16

def [](service)
  @@connections ||= Hash.new do |hash, key|
    hash[key] = class_for(key).new
  end
  @@connections[service]
end

.class_for(key) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/fog/bin/terremark_ecloud.rb', line 4

def class_for(key)
  case key
  when :compute
    Fog::TerremarkEcloud::Compute
  else
    # @todo Replace most instances of ArgumentError with NotImplementedError
    # @todo For a list of widely supported Exceptions, see:
    # => http://www.zenspider.com/Languages/Ruby/QuickRef.html#35
    raise ArgumentError, "Unsupported #{self} service: #{key}"
  end
end

.servicesObject



23
24
25
# File 'lib/fog/bin/terremark_ecloud.rb', line 23

def services
  [:compute]
end