Class: TempBuffer
- Inherits:
-
Object
- Object
- TempBuffer
- Defined in:
- lib/pg_data_encoder/temp_buffer.rb
Instance Method Summary collapse
-
#initialize ⇒ TempBuffer
constructor
A new instance of TempBuffer.
- #pos ⇒ Object
- #read ⇒ Object
- #reopen ⇒ Object
- #rewind ⇒ Object
- #size ⇒ Object
- #string ⇒ Object
- #write(st) ⇒ Object
Constructor Details
#initialize ⇒ TempBuffer
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
#pos ⇒ Object
22 23 24 |
# File 'lib/pg_data_encoder/temp_buffer.rb', line 22 def pos @st.bytesize end |
#read ⇒ Object
19 20 21 |
# File 'lib/pg_data_encoder/temp_buffer.rb', line 19 def read @st end |
#reopen ⇒ Object
16 17 18 |
# File 'lib/pg_data_encoder/temp_buffer.rb', line 16 def reopen @st = "" end |
#rewind ⇒ Object
13 14 15 |
# File 'lib/pg_data_encoder/temp_buffer.rb', line 13 def rewind end |
#size ⇒ Object
5 6 7 |
# File 'lib/pg_data_encoder/temp_buffer.rb', line 5 def size @st.bytesize end |
#string ⇒ Object
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 |