Class: Bora::StackStatus
- Inherits:
-
Object
- Object
- Bora::StackStatus
- Defined in:
- lib/bora/stack_status.rb
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(underlying_stack) ⇒ StackStatus
constructor
A new instance of StackStatus.
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(underlying_stack) ⇒ StackStatus
Returns a new instance of StackStatus.
5 6 7 8 9 10 |
# File 'lib/bora/stack_status.rb', line 5 def initialize() @stack = if @stack @status = Status.new(@stack.stack_status) end end |
Instance Method Details
#exists? ⇒ Boolean
12 13 14 |
# File 'lib/bora/stack_status.rb', line 12 def exists? @status && !@status.deleted? end |
#success? ⇒ Boolean
16 17 18 |
# File 'lib/bora/stack_status.rb', line 16 def success? @status && @status.success? end |
#to_s ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/bora/stack_status.rb', line 20 def to_s if @stack status_reason = @stack.stack_status_reason ? " - #{@stack.stack_status_reason}" : "" "#{@stack.stack_name} - #{@status}#{status_reason}" else "Stack does not exist" end end |