Class: Postgres::Clone::CommandResult

Inherits:
Object
  • Object
show all
Defined in:
lib/postgres/clone/command_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_codeObject (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

#outputObject (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

Returns:

  • (Boolean)


11
12
13
# File 'lib/postgres/clone/command_result.rb', line 11

def failed?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/postgres/clone/command_result.rb', line 15

def success?
  exit_code == 0
end