Class: Minx::IOChannel

Inherits:
Object
  • Object
show all
Defined in:
lib/minx/io_channel.rb

Direct Known Subclasses

FileChannel, SocketChannel

Instance Method Summary (collapse)

Constructor Details

- (IOChannel) initialize(io)

A new instance of IOChannel



4
5
6
# File 'lib/minx/io_channel.rb', line 4

def initialize(io)
  @io = io
end

Instance Method Details

- (Object) <<(message)



20
21
22
23
# File 'lib/minx/io_channel.rb', line 20

def << message
  write(message)
  return self
end

- (Object) each



12
13
14
# File 'lib/minx/io_channel.rb', line 12

def each
  yield read until @io.eof?
end

- (Object) read



8
9
10
# File 'lib/minx/io_channel.rb', line 8

def read
  @io.readline
end

- (Object) write(message)



16
17
18
# File 'lib/minx/io_channel.rb', line 16

def write(message)
  @io.write(message)
end