Class: AwesomeSpawn::CommandResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command_line, output, error, exit_status) ⇒ CommandResult

Returns a new instance of CommandResult.



5
6
7
8
9
10
# File 'lib/awesome_spawn/command_result.rb', line 5

def initialize(command_line, output, error, exit_status)
  @command_line = command_line
  @output       = output
  @error        = error
  @exit_status  = exit_status
end

Instance Attribute Details

#command_lineObject (readonly)

Returns the value of attribute command_line.



3
4
5
# File 'lib/awesome_spawn/command_result.rb', line 3

def command_line
  @command_line
end

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/awesome_spawn/command_result.rb', line 3

def error
  @error
end

#exit_statusObject (readonly)

Returns the value of attribute exit_status.



3
4
5
# File 'lib/awesome_spawn/command_result.rb', line 3

def exit_status
  @exit_status
end

#outputObject (readonly)

Returns the value of attribute output.



3
4
5
# File 'lib/awesome_spawn/command_result.rb', line 3

def output
  @output
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/awesome_spawn/command_result.rb', line 16

def failure?
  exit_status != 0
end

#inspectObject



20
21
22
# File 'lib/awesome_spawn/command_result.rb', line 20

def inspect
  "#{to_s.chop} @exit_status=#{@exit_status}>"
end

#success?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/awesome_spawn/command_result.rb', line 12

def success?
  exit_status == 0
end