Class: OpsworksHelpers::StatusChecks
- Inherits:
-
Object
- Object
- OpsworksHelpers::StatusChecks
- Defined in:
- lib/opsworks_helpers/status_checks.rb
Instance Attribute Summary collapse
-
#command_block ⇒ Object
readonly
Returns the value of attribute command_block.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
- #errors ⇒ Object
- #execute ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(command_block) ⇒ StatusChecks
constructor
A new instance of StatusChecks.
Constructor Details
#initialize(command_block) ⇒ StatusChecks
Returns a new instance of StatusChecks.
7 8 9 10 |
# File 'lib/opsworks_helpers/status_checks.rb', line 7 def initialize(command_block) @command_block = command_block @result = [true, {}] end |
Instance Attribute Details
#command_block ⇒ Object (readonly)
Returns the value of attribute command_block.
4 5 6 |
# File 'lib/opsworks_helpers/status_checks.rb', line 4 def command_block @command_block end |
#result ⇒ Object
Returns the value of attribute result.
5 6 7 |
# File 'lib/opsworks_helpers/status_checks.rb', line 5 def result @result end |
Instance Method Details
#errors ⇒ Object
20 21 22 |
# File 'lib/opsworks_helpers/status_checks.rb', line 20 def errors result[1] end |
#execute ⇒ Object
12 13 14 |
# File 'lib/opsworks_helpers/status_checks.rb', line 12 def execute self.result = command_block.call end |
#failed? ⇒ Boolean
16 17 18 |
# File 'lib/opsworks_helpers/status_checks.rb', line 16 def failed? result[0] == false end |