Class: Baykit::BayServer::Util::GzipCompressor::CallbackWriter
- Inherits:
-
Object
- Object
- Baykit::BayServer::Util::GzipCompressor::CallbackWriter
- Defined in:
- lib/baykit/bayserver/util/gzip_compressor.rb
Instance Attribute Summary collapse
-
#done_listener ⇒ Object
Returns the value of attribute done_listener.
-
#gzip_comp ⇒ Object
readonly
Returns the value of attribute gzip_comp.
Instance Method Summary collapse
-
#initialize(gzip_comp) ⇒ CallbackWriter
constructor
A new instance of CallbackWriter.
- #write(*str) ⇒ Object
Constructor Details
#initialize(gzip_comp) ⇒ CallbackWriter
Returns a new instance of CallbackWriter.
18 19 20 21 |
# File 'lib/baykit/bayserver/util/gzip_compressor.rb', line 18 def initialize(gzip_comp) @gzip_comp = gzip_comp @done_listener = nil end |
Instance Attribute Details
#done_listener ⇒ Object
Returns the value of attribute done_listener.
16 17 18 |
# File 'lib/baykit/bayserver/util/gzip_compressor.rb', line 16 def done_listener @done_listener end |
#gzip_comp ⇒ Object (readonly)
Returns the value of attribute gzip_comp.
15 16 17 |
# File 'lib/baykit/bayserver/util/gzip_compressor.rb', line 15 def gzip_comp @gzip_comp end |
Instance Method Details
#write(*str) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/baykit/bayserver/util/gzip_compressor.rb', line 23 def write(*str) # proc str.each do |item| @gzip_comp.listener.call(item, 0, item.length, &@done_listener) end end |