Class: Bora::Cfn::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/bora/cfn/status.rb

Instance Method Summary collapse

Constructor Details

#initialize(status) ⇒ Status

Returns a new instance of Status.



6
7
8
# File 'lib/bora/cfn/status.rb', line 6

def initialize(status)
  @status = status
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/bora/cfn/status.rb', line 22

def complete?
  success? || failure?
end

#deleted?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/bora/cfn/status.rb', line 18

def deleted?
  @status == 'DELETE_COMPLETE'
end

#failure?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/bora/cfn/status.rb', line 14

def failure?
  @status.end_with?('FAILED') || @status.include?('ROLLBACK')
end

#success?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/bora/cfn/status.rb', line 10

def success?
  @status.end_with?('_COMPLETE') && !@status.include?('ROLLBACK')
end

#to_sObject



26
27
28
# File 'lib/bora/cfn/status.rb', line 26

def to_s
  @status.colorize(color)
end