Class: Fog::Bin
- Inherits:
-
Object
show all
- Defined in:
- lib/fog/core/bin.rb
Direct Known Subclasses
AWS, Bluebox, Brightbox, GoGrid, Google, Linode, Local, NewServers, Rackspace, Slicehost, Terremark
Class Method Summary
collapse
Class Method Details
.available? ⇒ Boolean
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/fog/core/bin.rb', line 33
def available?
availability = true
for service in services
begin
service = self.class_for(service)
availability &&= service.requirements.all? { |requirement| Fog.credentials.include?(requirement) }
rescue ArgumentError => e
warning = "[yellow][WARN] #{e.message}[/]"
Formatador.display_line(warning)
availability = false
rescue => e
availability = false
end
end
if availability
for service in services
for collection in self.class_for(service).collections
unless self.respond_to?(collection)
self.class_eval <<-EOS, __FILE__, __LINE__
def self.#{collection}
self[:#{service}].#{collection}
end
EOS
end
end
end
end
availability
end
|
.collections ⇒ Object
65
66
67
|
# File 'lib/fog/core/bin.rb', line 65
def collections
services.map {|service| self[service].collections}.flatten.sort_by {|service| service.to_s}
end
|