Class: TempBuffer

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_data_encoder/temp_buffer.rb

Instance Method Summary collapse

Constructor Details

#initializeTempBuffer

Returns a new instance of TempBuffer.



2
3
4
# File 'lib/pg_data_encoder/temp_buffer.rb', line 2

def initialize
  @st = "".force_encoding("ASCII-8BIT")
end

Instance Method Details

#posObject



22
23
24
# File 'lib/pg_data_encoder/temp_buffer.rb', line 22

def pos
  @st.bytesize
end

#readObject



19
20
21
# File 'lib/pg_data_encoder/temp_buffer.rb', line 19

def read
  @st
end

#reopenObject



16
17
18
# File 'lib/pg_data_encoder/temp_buffer.rb', line 16

def reopen
  @st = ""
end

#rewindObject



13
14
15
# File 'lib/pg_data_encoder/temp_buffer.rb', line 13

def rewind

end

#sizeObject



5
6
7
# File 'lib/pg_data_encoder/temp_buffer.rb', line 5

def size 
  @st.bytesize
end

#stringObject



25
26
27
# File 'lib/pg_data_encoder/temp_buffer.rb', line 25

def string
  @st
end

#write(st) ⇒ Object



9
10
11
12
# File 'lib/pg_data_encoder/temp_buffer.rb', line 9

def write(st)

  @st << st.force_encoding("ASCII-8BIT")
end