Class: Ironfan::IaasProvider

Inherits:
Provider show all
Defined in:
lib/ironfan/headers.rb,
lib/ironfan/provider.rb

Defined Under Namespace

Classes: Machine

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Provider

aggregate!, forget!, load, prepare!, receive, #resources, resources, validate

Methods inherited from Builder

ui, #ui

Class Method Details

.machine_classObject


191
192
193
# File 'lib/ironfan/provider.rb', line 191

def self.machine_class
  self.const_get(:Machine)
end

Instance Method Details

#ensure_prerequisites!(computers) ⇒ Object

Manipulation


198
199
200
201
202
203
204
# File 'lib/ironfan/provider.rb', line 198

def ensure_prerequisites!(computers)
  # Create all things that aren't machines
  targets = resources.reject {|type| type < IaasProvider::Machine}
  computers.each do |computer|
    targets.each {|r| r.create! computer }
  end
end

#save!(computers) ⇒ Object


206
207
208
209
210
# File 'lib/ironfan/provider.rb', line 206

def save!(computers)
  computers.each do |computer|
    targets.each {|r| r.save! computer }
  end
end