Class: Mutant::Parallel::Pipe Private
- Inherits:
-
Object
- Object
- Mutant::Parallel::Pipe
- Includes:
- Unparser::Adamantium
- Defined in:
- lib/mutant/parallel/pipe.rb
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.
Class Method Summary collapse
- .from_io(io) ⇒ Object private
-
.with(io) ⇒ undefined
private
Run block with pipe in binmode.
Instance Method Summary collapse
-
#to_reader ⇒ IO
private
Parent reader end of the pipe.
-
#to_writer ⇒ IO
private
Writer end of the pipe.
Class Method Details
.from_io(io) ⇒ Object
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.
17 18 19 20 |
# File 'lib/mutant/parallel/pipe.rb', line 17 def self.from_io(io) reader, writer = io.pipe(binmode: true) new(reader:, writer:) end |
.with(io) ⇒ undefined
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.
Run block with pipe in binmode
11 12 13 14 15 |
# File 'lib/mutant/parallel/pipe.rb', line 11 def self.with(io) io.pipe(binmode: true) do |(reader, writer)| yield new(reader:, writer:) end end |
Instance Method Details
#to_reader ⇒ IO
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.
Parent reader end of the pipe
33 34 35 36 |
# File 'lib/mutant/parallel/pipe.rb', line 33 def to_reader writer.close reader end |
#to_writer ⇒ IO
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.
Writer end of the pipe
25 26 27 28 |
# File 'lib/mutant/parallel/pipe.rb', line 25 def to_writer reader.close writer end |