Class: Riser::Stream
- Inherits:
-
Object
show all
- Defined in:
- lib/riser/stream.rb
Instance Method Summary
collapse
Constructor Details
#initialize(io) ⇒ Stream
Returns a new instance of Stream.
11
12
13
|
# File 'lib/riser/stream.rb', line 11
def initialize(io)
@io = io
end
|
Instance Method Details
#<<(message) ⇒ Object
37
38
39
40
|
# File 'lib/riser/stream.rb', line 37
def <<(message)
write(message)
self
end
|
#close ⇒ Object
47
48
49
50
51
|
# File 'lib/riser/stream.rb', line 47
def close
flush
@io.close
nil
end
|
#flush ⇒ Object
42
43
44
45
|
# File 'lib/riser/stream.rb', line 42
def flush
@io.flush
self
end
|
#read(size) ⇒ Object
25
26
27
|
# File 'lib/riser/stream.rb', line 25
def read(size)
@io.read(size)
end
|
#readpartial(maxlen, outbuf = nil) ⇒ Object
29
30
31
|
# File 'lib/riser/stream.rb', line 29
def readpartial(maxlen, outbuf=nil)
@io.readpartial(maxlen, outbuf)
end
|
#to_io ⇒ Object
15
16
17
|
# File 'lib/riser/stream.rb', line 15
def to_io
@io.to_io
end
|
#write(message) ⇒ Object
33
34
35
|
# File 'lib/riser/stream.rb', line 33
def write(message)
@io.write(message)
end
|