Class: ProcessExecuter::Destinations::MonitoredPipe Private

Inherits:
DestinationBase show all
Defined in:
lib/process_executer/destinations/monitored_pipe.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Handles monitored pipes

Instance Attribute Summary

Attributes inherited from DestinationBase

#destination

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DestinationBase

compatible_with_monitored_pipe?, #compatible_with_monitored_pipe?, #initialize

Constructor Details

This class inherits a constructor from ProcessExecuter::Destinations::DestinationBase

Class Method Details

.handles?(destination) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determines if this class can handle the given destination

Parameters:

  • destination (Object)

    the destination to check

Returns:

  • (Boolean)

    true if destination is a ProcessExecuter::MonitoredPipe



42
43
44
# File 'lib/process_executer/destinations/monitored_pipe.rb', line 42

def self.handles?(destination)
  destination.is_a? ProcessExecuter::MonitoredPipe
end

Instance Method Details

#close

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Does nothing: closing a caller-provided pipe is the caller's responsibility

The library closes only pipes it creates. A MonitoredPipe given as a redirection destination was created by the caller, and the MonitoredPipe documentation makes closing it the caller's responsibility.



36
# File 'lib/process_executer/destinations/monitored_pipe.rb', line 36

def close; end

#write(data) ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Writes data to the monitored pipe

Examples:

stringio_dest = StringIO.new
pipe = ProcessExecuter::MonitoredPipe.new(stringio_dest)
pipe_handler = ProcessExecuter::Destinations::MonitoredPipe.new(pipe)
pipe_handler.write("Data to pipe")

Parameters:

  • data (String)

    the data to write

Returns:

  • (Integer)

    the number of bytes written



23
24
25
26
# File 'lib/process_executer/destinations/monitored_pipe.rb', line 23

def write(data)
  super
  destination.write data
end