Class: EventMachine::HttpDecoders::Base
- Inherits:
-
Object
- Object
- EventMachine::HttpDecoders::Base
- Defined in:
- lib/em-http/decoders.rb
Class Method Summary collapse
Instance Method Summary collapse
- #<<(compressed) ⇒ Object
- #finalize! ⇒ Object
-
#initialize(&chunk_callback) ⇒ Base
constructor
- chunk_callback
- Block
-
To handle a decompressed chunk.
Constructor Details
#initialize(&chunk_callback) ⇒ Base
- chunk_callback
- Block
-
To handle a decompressed chunk
32 33 34 |
# File 'lib/em-http/decoders.rb', line 32 def initialize(&chunk_callback) @chunk_callback = chunk_callback end |
Class Method Details
.encoding_names ⇒ Object
25 26 27 28 |
# File 'lib/em-http/decoders.rb', line 25 def self.encoding_names name = to_s.split('::').last.downcase [name] end |
Instance Method Details
#<<(compressed) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/em-http/decoders.rb', line 36 def <<(compressed) return unless compressed && compressed.size > 0 decompressed = decompress(compressed) receive_decompressed decompressed end |
#finalize! ⇒ Object
43 44 45 46 |
# File 'lib/em-http/decoders.rb', line 43 def finalize! decompressed = finalize receive_decompressed decompressed end |