Class: Postgres::Clone::CommandResult
- Inherits:
-
Object
- Object
- Postgres::Clone::CommandResult
- Defined in:
- lib/postgres/clone/command_result.rb
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(exit_code:, output:) ⇒ CommandResult
constructor
A new instance of CommandResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(exit_code:, output:) ⇒ CommandResult
Returns a new instance of CommandResult.
6 7 8 9 |
# File 'lib/postgres/clone/command_result.rb', line 6 def initialize(exit_code:, output:) @exit_code = exit_code @output = output.strip end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
4 5 6 |
# File 'lib/postgres/clone/command_result.rb', line 4 def exit_code @exit_code end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/postgres/clone/command_result.rb', line 4 def output @output end |
Instance Method Details
#failed? ⇒ Boolean
11 12 13 |
# File 'lib/postgres/clone/command_result.rb', line 11 def failed? !success? end |
#success? ⇒ Boolean
15 16 17 |
# File 'lib/postgres/clone/command_result.rb', line 15 def success? exit_code == 0 end |