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



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

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

#cloudsObject

Global hash of clouds



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

def clouds
  $clouds ||= {}
end

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

TODO: Deprecate



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

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