Class: Conjure::Instance::Collection
- Inherits:
-
Object
- Object
- Conjure::Instance::Collection
- Includes:
- Enumerable
- Defined in:
- lib/conjure/instance.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(options) ⇒ Collection
constructor
A new instance of Collection.
- #server ⇒ Object
Constructor Details
#initialize(options) ⇒ Collection
Returns a new instance of Collection.
22 23 24 |
# File 'lib/conjure/instance.rb', line 22 def initialize() @application = [: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 |
#server ⇒ Object
26 27 28 |
# File 'lib/conjure/instance.rb', line 26 def server @server ||= Service::CloudServer.new("#{@application.name}-production") if @application end |