class ProcessExecuter::Destinations::Stdout

Handles standard output redirection

@api private

Public Class Methods

handles?(destination) click to toggle source

Determines if this class can handle the given destination

@param destination [Object] the destination to check @return [Boolean] true if destination is :out or 1

# File lib/process_executer/destinations/stdout.rb, line 30
def self.handles?(destination)
  [:out, 1].include?(destination)
end

Public Instance Methods

write(data) click to toggle source

Writes data to standard output

@example

stdout_handler = ProcessExecuter::Destinations::Stdout.new(:out)
stdout_handler.write("Hello world")

@param data [String] the data to write

@return [Integer] the number of bytes written

# File lib/process_executer/destinations/stdout.rb, line 21
def write(data)
  super
  $stdout.write data
end