Class: PVC::InputPiece::Runner
- Inherits:
-
Object
- Object
- PVC::InputPiece::Runner
- Defined in:
- lib/pvc/input_piece.rb
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(input) ⇒ Runner
constructor
A new instance of Runner.
- #start(following_piece) ⇒ Object
- #stdin ⇒ Object
Constructor Details
#initialize(input) ⇒ Runner
Returns a new instance of Runner.
5 6 7 8 9 10 |
# File 'lib/pvc/input_piece.rb', line 5 def initialize(input) @input = input @read, @write = IO.pipe @read.close_on_exec = true @write.close_on_exec = true end |
Instance Method Details
#finish ⇒ Object
21 22 23 24 |
# File 'lib/pvc/input_piece.rb', line 21 def finish @write.close @read.close end |
#start(following_piece) ⇒ Object
16 17 18 19 |
# File 'lib/pvc/input_piece.rb', line 16 def start(following_piece) following_piece.stdin.write(@input) following_piece.stdin.flush end |
#stdin ⇒ Object
12 13 14 |
# File 'lib/pvc/input_piece.rb', line 12 def stdin @write end |