class Zip::SliceSource
- Zip::SliceSource
- Zip::Source
- Reference
- Object
Overview
Use slice as a source for Archive#add
or Archive#replace
.
Example
# create slice
slice = Slice.new(10) { |i| i + 10 }
# create source
source = SliceSource.new(zip, slice)
# add slice to archive as "foo.txt"
zip.add("foo.txt", source)
Defined in:
zip/sources.crConstructors
-
.new(zip : Archive, s : Slice)
Create a new
SliceSource
from the given slice.
Instance methods inherited from class Zip::Source
to_unsafe : LibZip::ZipSourceT
to_unsafe
Constructor Detail
Create a new SliceSource
from the given slice.
Raises an exception if this SliceSource
could not be created.
Example
# create slice
slice = Slice.new(10) { |i| i + 10 }
# create source
source = SliceSource.new(zip, slice)
# add slice to archive as "foo.txt"
zip.add("foo.txt", source)