Class: FunkySystem::ProgramOutput

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pid, status, stdout, stderr, unused_stdin) ⇒ ProgramOutput

Returns a new instance of ProgramOutput.



39
40
41
42
# File 'lib/funkysystem.rb', line 39

def initialize(pid, status, stdout, stderr, unused_stdin)
  @pid, @status, @stdout, @stderr, @unused_stdin =
    pid, status, stdout, stderr, unused_stdin
end

Instance Attribute Details

#pidObject (readonly)

Returns the value of attribute pid.



38
39
40
# File 'lib/funkysystem.rb', line 38

def pid
  @pid
end

#statusObject (readonly)

Returns the value of attribute status.



38
39
40
# File 'lib/funkysystem.rb', line 38

def status
  @status
end

#stderrObject (readonly)

Returns the value of attribute stderr.



38
39
40
# File 'lib/funkysystem.rb', line 38

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



38
39
40
# File 'lib/funkysystem.rb', line 38

def stdout
  @stdout
end

#unused_stdinObject (readonly)

Returns the value of attribute unused_stdin.



38
39
40
# File 'lib/funkysystem.rb', line 38

def unused_stdin
  @unused_stdin
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/funkysystem.rb', line 43

def error?
  ! @status.success?
end

#success?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/funkysystem.rb', line 46

def success?
  @status.success?
end