Class: WriteFile
- Inherits:
-
Object
- Object
- WriteFile
- Defined in:
- lib/writeexcel/write_file.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#append(*args) ⇒ Object
_append($data).
-
#prepend(*args) ⇒ Object
_prepend($data).
Instance Method Details
#append(*args) ⇒ Object
_append($data)
General storage function
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/writeexcel/write_file.rb', line 28 def append(*args) data = ruby_18 { args.join } || ruby_19 { args.collect{ |arg| arg.dup.force_encoding('ASCII-8BIT') }.join } # Add CONTINUE records if necessary data = add_continue(data) if data.bytesize > @limit if @using_tmpfile @filehandle.write data @datasize += data.bytesize else @datasize += data.bytesize @data = @data + data end data end |
#prepend(*args) ⇒ Object
_prepend($data)
General storage function
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/writeexcel/write_file.rb', line 10 def prepend(*args) data = ruby_18 { args.join } || ruby_19 { args.collect{ |arg| arg.dup.force_encoding('ASCII-8BIT') }.join } data = add_continue(data) if data.bytesize > @limit @datasize += data.bytesize @data = data + @data data end |