Class: Buff::ShellOut::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/buff/shell_out/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exitstatus, stdout, stderr) ⇒ Response

Returns a new instance of Response

Parameters:

  • exitstatus (Fixnum)
  • stdout (String)
  • stderr (String)

14
15
16
17
18
# File 'lib/buff/shell_out/response.rb', line 14

def initialize(exitstatus, stdout, stderr)
  @exitstatus = exitstatus
  @stdout     = stdout
  @stderr     = stderr
end

Instance Attribute Details

#exitstatusFixnum (readonly)

Returns:

  • (Fixnum)

5
6
7
# File 'lib/buff/shell_out/response.rb', line 5

def exitstatus
  @exitstatus
end

#stderrString (readonly)

Returns:

  • (String)

9
10
11
# File 'lib/buff/shell_out/response.rb', line 9

def stderr
  @stderr
end

#stdoutString (readonly)

Returns:

  • (String)

7
8
9
# File 'lib/buff/shell_out/response.rb', line 7

def stdout
  @stdout
end

Instance Method Details

#error?Boolean Also known as: failure?

Returns:

  • (Boolean)

24
25
26
# File 'lib/buff/shell_out/response.rb', line 24

def error?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)

20
21
22
# File 'lib/buff/shell_out/response.rb', line 20

def success?
  exitstatus == 0
end