Class: OpsWorks::App

Inherits:
Resource show all
Defined in:
lib/opsworks/app.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

account, client, #initialize

Constructor Details

This class inherits a constructor from OpsWorks::Resource

Instance Attribute Details

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/opsworks/app.rb', line 6

def id
  @id
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/opsworks/app.rb', line 6

def name
  @name
end

#revisionObject

Returns the value of attribute revision.



6
7
8
# File 'lib/opsworks/app.rb', line 6

def revision
  @revision
end

Class Method Details

.from_collection_response(response) ⇒ Object



8
9
10
11
12
13
# File 'lib/opsworks/app.rb', line 8

def self.from_collection_response(response)
  response.data[:apps].map do |hash|
    revision = hash[:app_source][:revision] if hash[:app_source]
    new(id: hash[:app_id], name: hash[:name], revision: revision)
  end
end

Instance Method Details

#deploymentsObject



15
16
17
# File 'lib/opsworks/app.rb', line 15

def deployments
  @deployments ||= initialize_deployments
end

#last_deploymentObject



19
20
21
# File 'lib/opsworks/app.rb', line 19

def last_deployment
  deployments.find(&:success?)
end