Module: ZipTricks::NullWriter
- Defined in:
- lib/zip_tricks/null_writer.rb
Overview
Used when you need to supply a destination IO for some write operations, but want to discard the data (like when estimating the size of a ZIP)
Class Method Summary collapse
- .<<(data) ⇒ self
-
.write(data) ⇒ Fixnum
The amount of data that was supposed to be written.
Class Method Details
.<<(data) ⇒ self
7 |
# File 'lib/zip_tricks/null_writer.rb', line 7 def self.<<(data); self; end |
.write(data) ⇒ Fixnum
Returns the amount of data that was supposed to be written.
11 |
# File 'lib/zip_tricks/null_writer.rb', line 11 def self.write(data); data.bytesize; end |