Class: Opsworks::Ssh::Config::Environment
- Inherits:
-
Object
- Object
- Opsworks::Ssh::Config::Environment
- Defined in:
- lib/opsworks/ssh/config/environment.rb
Constant Summary collapse
- LAYER_NAME =
'app'
Instance Attribute Summary collapse
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
-
#stack_id ⇒ Object
readonly
Returns the value of attribute stack_id.
Instance Method Summary collapse
-
#initialize(stack: nil) ⇒ Environment
constructor
A new instance of Environment.
- #name ⇒ Object
- #servers ⇒ Object
Constructor Details
#initialize(stack: nil) ⇒ Environment
Returns a new instance of Environment.
9 10 11 12 |
# File 'lib/opsworks/ssh/config/environment.rb', line 9 def initialize(stack: nil) @stack = stack @stack_id = stack.stack_id end |
Instance Attribute Details
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
7 8 9 |
# File 'lib/opsworks/ssh/config/environment.rb', line 7 def stack @stack end |
#stack_id ⇒ Object (readonly)
Returns the value of attribute stack_id.
7 8 9 |
# File 'lib/opsworks/ssh/config/environment.rb', line 7 def stack_id @stack_id end |
Instance Method Details
#name ⇒ Object
14 15 16 |
# File 'lib/opsworks/ssh/config/environment.rb', line 14 def name @name ||= @stack.name.gsub(/-/, '_') end |
#servers ⇒ Object
18 19 20 21 22 |
# File 'lib/opsworks/ssh/config/environment.rb', line 18 def servers instances.map do |instance| Server.new(instance: instance) end.select(&:active?) end |