kernel/common/process_mirror.rb
def fd_to_io(object)
          case object
          when ::IO, ::STDIN, ::STDOUT, ::STDERR, $stdin, $stdout, $stderr
            object
          when :in, 0
            ::STDIN
          when :out, 1
            ::STDOUT
          when :err, 2
            ::STDERR
          when ::Fixnum
            object >= 0 ? ::IO.for_fd(object) : nil
          else
            object.respond_to?(:to_io) ? object.to_io : nil
          end
        end
# Convert a fd identifier to an IO object.
#
# Returns nil or an instance of IO.
Convert a fd identifier to an IO object.
Returns nil or an instance of IO.
Convert a fd identifier to an IO object . Returns nil or an instance of IO .
def fd_to_io(object)
          case object
          when ::IO, ::STDIN, ::STDOUT, ::STDERR, $stdin, $stdout, $stderr
            object
          when :in, 0
            ::STDIN
          when :out, 1
            ::STDOUT
          when :err, 2
            ::STDERR
          when ::Fixnum
            object >= 0 ? ::IO.for_fd(object) : nil
          else
            object.respond_to?(:to_io) ? object.to_io : nil
          end
        end
def fd_to_io ( object ) case object when :: IO , :: STDIN , :: STDOUT , :: STDERR , $stdin , $stdout , $stderr object when :in , 0 :: STDIN when :out , 1 :: STDOUT when :err , 2 :: STDERR when :: Fixnum object >= 0 ? :: IO . for_fd ( object ) : nil else object . respond_to? ( :to_io ) ? object . to_io : nil end end
Convert a fd identifier to an IO object.
Convert a fd identifier to an IO object .
object