Class: Conjure::Instance::Collection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/conjure/instance.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Collection

Returns a new instance of Collection.



22
23
24
# File 'lib/conjure/instance.rb', line 22

def initialize(options)
  @application = options[:application]
end

Instance Method Details

#each(&block) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/conjure/instance.rb', line 30

def each(&block)
  if server and server.existing_server
    yield Instance.new(
      :application => @application,
      :rails_environment => "production",
      :ip_address => server.ip_address
    )
  end
end

#serverObject



26
27
28
# File 'lib/conjure/instance.rb', line 26

def server
  @server ||= Service::CloudServer.new("#{@application.name}-production") if @application
end