Class: ZipTricks::Streamer::Writable
- Inherits:
-
Object
- Object
- ZipTricks::Streamer::Writable
- Defined in:
- lib/zip_tricks/streamer/writable.rb
Overview
Gets yielded from the writing methods of the CompressingStreamer and accepts the data being written into the ZIP
Instance Method Summary collapse
-
#<<(d) ⇒ self
Writes the given data to the output stream.
-
#initialize(writer) ⇒ Writable
constructor
Initializes a new Writable with the object it delegates the writes to.
-
#write(d) ⇒ Fixnum
Writes the given data to the output stream.
Constructor Details
#initialize(writer) ⇒ Writable
Initializes a new Writable with the object it delegates the writes to. Normally you would not need to use this method directly
6 7 8 |
# File 'lib/zip_tricks/streamer/writable.rb', line 6 def initialize(writer) @writer = writer end |
Instance Method Details
#<<(d) ⇒ self
Writes the given data to the output stream
13 |
# File 'lib/zip_tricks/streamer/writable.rb', line 13 def <<(d); @writer << d; self; end |
#write(d) ⇒ Fixnum
Writes the given data to the output stream
19 |
# File 'lib/zip_tricks/streamer/writable.rb', line 19 def write(d); @writer << d; d.bytesize; end |