Class: Xlsxtream::IO::RubyZip

Inherits:
Object
  • Object
show all
Defined in:
lib/xlsxtream/io/rubyzip.rb

Defined Under Namespace

Classes: StreamingDeflater, UnbufferedZipOutputStream

Instance Method Summary collapse

Constructor Details

#initialize(path_or_io) ⇒ RubyZip

Returns a new instance of RubyZip.



6
7
8
9
# File 'lib/xlsxtream/io/rubyzip.rb', line 6

def initialize(path_or_io)
  stream = path_or_io.respond_to? :reopen
  @zos = UnbufferedZipOutputStream.new(path_or_io, stream)
end

Instance Method Details

#<<(data) ⇒ Object



11
12
13
# File 'lib/xlsxtream/io/rubyzip.rb', line 11

def <<(data)
  @zos << data
end

#add_file(path) ⇒ Object



15
16
17
# File 'lib/xlsxtream/io/rubyzip.rb', line 15

def add_file(path)
  @zos.put_next_entry path
end

#closeObject



19
20
21
# File 'lib/xlsxtream/io/rubyzip.rb', line 19

def close
  @zos.close
end