Class: TTK::Streams::Pipe::PipeWrapper
- Defined in:
- lib/ttk/strategies/Streams/Pipe.rb
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(input) ⇒ PipeWrapper
constructor
attr_reader :rd, :wr.
- #open(mode = 'r') ⇒ Object
- #read ⇒ Object
Constructor Details
#initialize(input) ⇒ PipeWrapper
attr_reader :rd, :wr
14 15 16 17 |
# File 'lib/ttk/strategies/Streams/Pipe.rb', line 14 def initialize ( input ) # @input = input @rd, @wr = IO.pipe end |
Instance Method Details
#exist? ⇒ Boolean
26 27 28 |
# File 'lib/ttk/strategies/Streams/Pipe.rb', line 26 def exist? true end |
#open(mode = 'r') ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/ttk/strategies/Streams/Pipe.rb', line 18 def open ( mode='r' ) case mode when 'r' then @rd when 'w' then @wr else raise end end |
#read ⇒ Object
29 30 31 |
# File 'lib/ttk/strategies/Streams/Pipe.rb', line 29 def read @rd.read end |