Class: EventMachine::HttpDecoders::Base

### Home Classes Methods

### In Files

- lib/em-http/decoders.rb

### Parent

Object

### Methods

- ::encoding_names
- ::new
- #<<
- #decompress
- #finalize
- #finalize!

### Class/Module Index

Quicksearch

- EventMachine
- EventMachine::HTTPMethods
- EventMachine::HttpClient
- EventMachine::HttpClient::CookieJar
- EventMachine::HttpConnection
- EventMachine::HttpDecoders
- EventMachine::HttpDecoders::Base
- EventMachine::HttpDecoders::DecoderError
- EventMachine::HttpDecoders::Deflate
- EventMachine::HttpDecoders::GZip
- EventMachine::HttpDecoders::GZipHeader
- EventMachine::HttpEncoding
- EventMachine::HttpRequest
- EventMachine::HttpResponseHeader
- EventMachine::HttpStatus
- EventMachine::HttpStubConnection
- EventMachine::Middleware
- EventMachine::Middleware::DigestAuth
- EventMachine::Middleware::JSONResponse
- EventMachine::Middleware::OAuth
- EventMachine::Middleware::OAuth2
- EventMachine::MultiRequest
- HttpClientOptions
- HttpConnectionOptions
- String

No matching classes.

# EventMachine::HttpDecoders::Base

### Public Class Methods

encoding_names() click to toggle source

    # File lib/em-http/decoders.rb, line 25
    def self.encoding_names
      name = to_s.split('::').last.downcase
      [name]
    end

new(&chunk_callback) click to toggle source

chunk_callback | Block To handle a decompressed chunk

    # File lib/em-http/decoders.rb, line 32
    def initialize(&chunk_callback)
      @chunk_callback = chunk_callback
    end

### Public Instance Methods

<<(compressed) click to toggle source

    # File lib/em-http/decoders.rb, line 36
    def <<(compressed)
      return unless compressed && compressed.size > 0

      decompressed = decompress(compressed)
      receive_decompressed decompressed
    end

finalize!() click to toggle source

    # File lib/em-http/decoders.rb, line 43
    def finalize!
      decompressed = finalize
      receive_decompressed decompressed
    end

### Protected Instance Methods

decompress(compressed) click to toggle source

Must return a part of decompressed

    # File lib/em-http/decoders.rb, line 60
    def decompress(compressed)
      nil
    end

finalize() click to toggle source

May return last part

    # File lib/em-http/decoders.rb, line 66
    def finalize
      nil
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.