class Zip::StringSource
- Zip::StringSource
- Zip::Source
- Reference
- Object
Overview
Use string as a source for Archive#add
or Archive#replace
.
Example
# create a new string source
src = Zip::StringSource.new(zip, "test string")
# add to archive as "foo.txt"
zip.add("foo.txt", src)
Defined in:
zip/sources.crConstructors
-
.new(zip : Archive, s : String)
Create a new
StringSource
from the given string.
Instance methods inherited from class Zip::Source
to_unsafe : LibZip::ZipSourceT
to_unsafe
Constructor Detail
Create a new StringSource
from the given string.
Example
# create a new string source
src = Zip::StringSource.new(zip, "test string")
# add to archive as "foo.txt"
zip.add("foo.txt", src)