Class: Dumbwaiter::Instance
- Inherits:
-
Object
- Object
- Dumbwaiter::Instance
- Defined in:
- lib/dumbwaiter/instance.rb
Instance Attribute Summary collapse
-
#layer ⇒ Object
readonly
Returns the value of attribute layer.
-
#opsworks ⇒ Object
readonly
Returns the value of attribute opsworks.
-
#opsworks_instance ⇒ Object
readonly
Returns the value of attribute opsworks_instance.
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(layer, opsworks_instance, opsworks = Aws::OpsWorks.new(region: "us-east-1")) ⇒ Instance
constructor
A new instance of Instance.
Constructor Details
#initialize(layer, opsworks_instance, opsworks = Aws::OpsWorks.new(region: "us-east-1")) ⇒ Instance
Returns a new instance of Instance.
9 10 11 12 13 |
# File 'lib/dumbwaiter/instance.rb', line 9 def initialize(layer, opsworks_instance, opsworks = Aws::OpsWorks.new(region: "us-east-1")) @layer = layer @opsworks_instance = opsworks_instance @opsworks = opsworks end |
Instance Attribute Details
#layer ⇒ Object (readonly)
Returns the value of attribute layer.
2 3 4 |
# File 'lib/dumbwaiter/instance.rb', line 2 def layer @layer end |
#opsworks ⇒ Object (readonly)
Returns the value of attribute opsworks.
2 3 4 |
# File 'lib/dumbwaiter/instance.rb', line 2 def opsworks @opsworks end |
#opsworks_instance ⇒ Object (readonly)
Returns the value of attribute opsworks_instance.
2 3 4 |
# File 'lib/dumbwaiter/instance.rb', line 2 def opsworks_instance @opsworks_instance end |
Class Method Details
.all(layer, opsworks = Aws::OpsWorks.new(region: "us-east-1")) ⇒ Object
4 5 6 7 |
# File 'lib/dumbwaiter/instance.rb', line 4 def self.all(layer, opsworks = Aws::OpsWorks.new(region: "us-east-1")) instances = opsworks.describe_instances(layer_id: layer.id).instances instances.map { |instance| new(layer, instance, opsworks) } end |
Instance Method Details
#id ⇒ Object
15 16 17 |
# File 'lib/dumbwaiter/instance.rb', line 15 def id opsworks_instance.instance_id end |