Sha256: 730cc5ba1e7277f22267d4b78e947273678dd792c264b47b52de0e256b91f48d

Contents?: true

Size: 974 Bytes

Versions: 4

Compression:

Stored size: 974 Bytes

Contents

# -*- coding: utf-8 -*-

class WriteFile
  ###############################################################################
  #
  # _prepend($data)
  #
  # General storage function
  #
  def prepend(*args)
    data = 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

  ###############################################################################
  #
  # _append($data)
  #
  # General storage function
  #
  def append(*args)
    data = 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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
writeexcel-0.5.0 lib/writeexcel/write_file.rb
writeexcel-0.4.3 lib/writeexcel/write_file.rb
writeexcel-0.4.2 lib/writeexcel/write_file.rb
writeexcel-0.4.1 lib/writeexcel/write_file.rb