summaryrefslogtreecommitdiff
path: root/code/snippets/pipe_io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'code/snippets/pipe_io.rb')
-rw-r--r--code/snippets/pipe_io.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/code/snippets/pipe_io.rb b/code/snippets/pipe_io.rb
new file mode 100644
index 0000000..f2f817b
--- /dev/null
+++ b/code/snippets/pipe_io.rb
@@ -0,0 +1,5 @@
+reader, writer = IO.pipe
+writer.write("Into the pipe I go...")
+writer.close
+puts reader.read
+