Method: CMUX::Channel#open

Defined in:
lib/cmux/channel.rb

#open(&block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cmux/channel.rb', line 12

def open(&block)
  io = IO.open_tty @device
  if block_given?
    begin
      yield io
    ensure
      io.close
    end
  else
    io
  end
end