Module: Fog::Provider

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



9
10
11
# File 'lib/fog/core/provider.rb', line 9

def self.extended(base)
  Fog.providers << base.to_s.split('::').last
end

Instance Method Details

#[](service_key) ⇒ Object



13
14
15
# File 'lib/fog/core/provider.rb', line 13

def [](service_key)
  eval(@services_registry[service_key]).new
end

#service(new_service, path, constant_string) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/fog/core/provider.rb', line 17

def service(new_service, path, constant_string)
  Fog.services[new_service] ||= []
  Fog.services[new_service] |= [self.to_s.split('::').last.downcase.to_sym]
  @services_registry ||= {}
  @services_registry[new_service] = [self.to_s, constant_string].join('::')
  require File.join('fog', path)
end

#servicesObject



25
26
27
# File 'lib/fog/core/provider.rb', line 25

def services
  @services_registry.keys
end