Class: OpsWorks::App
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#revision ⇒ Object
Returns the value of attribute revision.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Resource
Constructor Details
This class inherits a constructor from OpsWorks::Resource
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/opsworks/app.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/opsworks/app.rb', line 3 def name @name end |
#revision ⇒ Object
Returns the value of attribute revision.
3 4 5 |
# File 'lib/opsworks/app.rb', line 3 def revision @revision end |
Class Method Details
.from_collection_response(client, response) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/opsworks/app.rb', line 5 def self.from_collection_response(client, response) response.data[:apps].map do |app| hash = app.to_h revision = hash[:app_source][:revision] if hash[:app_source] new(client, id: hash[:app_id], name: hash[:name], revision: revision) end end |
Instance Method Details
#deployments ⇒ Object
13 14 15 |
# File 'lib/opsworks/app.rb', line 13 def deployments @deployments ||= initialize_deployments end |
#last_deployment ⇒ Object
17 18 19 |
# File 'lib/opsworks/app.rb', line 17 def last_deployment deployments.find(&:success?) end |
#update_revision(revision) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/opsworks/app.rb', line 21 def update_revision(revision) client.update_app( app_id: id, app_source: { revision: revision } ) self.revision = revision end |