Class: ProcessExecuter::Destinations::DestinationBase Private
- Inherits:
-
Object
- Object
- ProcessExecuter::Destinations::DestinationBase
- Defined in:
- lib/process_executer/destinations/destination_base.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.
Base class for all destination handlers
Provides the common interface and functionality for all destination classes that handle different types of output redirection.
Direct Known Subclasses
ChildRedirection, Close, FileDescriptor, FilePath, FilePathMode, FilePathModePerms, IO, MonitoredPipe, Stderr, Stdout, Tee, Writer
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
private
The destination object this handler manages.
Class Method Summary collapse
-
.compatible_with_monitored_pipe? ⇒ Boolean
private
Determines if this destination class can be wrapped by MonitoredPipe.
-
.handles?(destination) ⇒ Boolean
private
Determines if this class can handle the given destination.
Instance Method Summary collapse
-
#close
private
Closes the destination if necessary.
-
#compatible_with_monitored_pipe? ⇒ Boolean
private
Determines if this destination instance can be wrapped by MonitoredPipe.
-
#initialize(destination) ⇒ DestinationBase
constructor
private
Initializes a new destination handler.
-
#write(_data) ⇒ Integer
private
Writes data to the destination.
Constructor Details
#initialize(destination) ⇒ DestinationBase
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.
Initializes a new destination handler
16 17 18 |
# File 'lib/process_executer/destinations/destination_base.rb', line 16 def initialize(destination) @destination = destination end |
Instance Attribute Details
#destination ⇒ Object (readonly)
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.
The destination object this handler manages
23 24 25 |
# File 'lib/process_executer/destinations/destination_base.rb', line 23 def destination @destination end |
Class Method Details
.compatible_with_monitored_pipe? ⇒ 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 destination class can be wrapped by MonitoredPipe
All destination types can be wrapped by MonitoredPipe unless they explicitly opt out.
63 |
# File 'lib/process_executer/destinations/destination_base.rb', line 63 def self.compatible_with_monitored_pipe? = true |
.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
This is an abstract class method that must be implemented by subclasses.
53 54 55 |
# File 'lib/process_executer/destinations/destination_base.rb', line 53 def self.handles?(destination) raise NotImplementedError 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.
Closes the destination if necessary
By default, this method does nothing. Subclasses should override this method if they need to perform cleanup.
44 |
# File 'lib/process_executer/destinations/destination_base.rb', line 44 def close; end |
#compatible_with_monitored_pipe? ⇒ 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 destination instance can be wrapped by MonitoredPipe
68 69 70 |
# File 'lib/process_executer/destinations/destination_base.rb', line 68 def compatible_with_monitored_pipe? self.class.compatible_with_monitored_pipe? 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 destination
Subclasses should override this method to provide specific write behavior. The base implementation is a no-op.
34 35 36 |
# File 'lib/process_executer/destinations/destination_base.rb', line 34 def write(_data) 0 end |