Method: ProcessExecuter::Options::SpawnOptions#redirection?

Defined in:
lib/process_executer/options/spawn_options.rb

#redirection?(option_key) ⇒ 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.

Determine if the given option key indicates a redirection option

Parameters:

  • option_key (Symbol, Integer, IO, Array)

    the option key to be tested

Returns:

  • (Boolean)


49
50
51
52
# File 'lib/process_executer/options/spawn_options.rb', line 49

def redirection?(option_key)
  test = ->(key) { i[in out err].include?(key) || key.is_a?(Integer) || (key.is_a?(IO) && !key.fileno.nil?) }
  test.call(option_key) || (option_key.is_a?(Array) && option_key.all? { |key| test.call(key) })
end