Class: Kronk::BufferedIO

Inherits:
Net::BufferedIO
  • Object
show all
Defined in:
lib/kronk/buffered_io.rb

Overview

Wrapper for Net::BufferedIO

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ BufferedIO

Returns a new instance of BufferedIO.



11
12
13
14
15
# File 'lib/kronk/buffered_io.rb', line 11

def initialize io
  super
  @raw_output = nil
  @response   = nil
end

Instance Attribute Details

#raw_outputObject

Returns the value of attribute raw_output.



8
9
10
# File 'lib/kronk/buffered_io.rb', line 8

def raw_output
  @raw_output
end

#responseObject

Returns the value of attribute response.



9
10
11
# File 'lib/kronk/buffered_io.rb', line 9

def response
  @response
end

Instance Method Details

#clearObject



23
24
25
26
27
# File 'lib/kronk/buffered_io.rb', line 23

def clear
  @rbuf = ""
  @raw_output = nil
  @response   = nil
end

#rewindObject



18
19
20
# File 'lib/kronk/buffered_io.rb', line 18

def rewind
  @rbuf.replace @raw_output if @raw_output
end