Module: PoolParty::Cloud

Included in:
Object
Defined in:
lib/poolparty/poolparty/cloud.rb

Defined Under Namespace

Classes: Cloud

Instance Method Summary collapse

Instance Method Details

#cloud(name, &block) ⇒ Object

Instantiate a new cloud



7
8
9
# File 'lib/poolparty/poolparty/cloud.rb', line 7

def cloud(name, &block)
  clouds[name] ||= Cloud.new(name, &block)
end

#cloudsObject

Global hash of clouds



12
13
14
# File 'lib/poolparty/poolparty/cloud.rb', line 12

def clouds
  $clouds ||= {}
end

#with_cloud(cl, opts = {}, &block) ⇒ Object

TODO: Deprecate



17
18
19
20
21
# File 'lib/poolparty/poolparty/cloud.rb', line 17

def with_cloud(cl, opts={}, &block)
  raise CloudNotFoundException.new("Cloud not found") unless cl
  cl.options.merge!(opts) if opts
  cl.run_in_context &block if block
end