Module: EventMachine::HttpDecoders

Defined in:
lib/em-http/decoders.rb

Overview

Provides a unified callback interface to decompression libraries.

Defined Under Namespace

Classes: Base, DecoderError, Deflate, GZip, GZipHeader

Constant Summary

DECODERS =
[Deflate, GZip]

Class Method Summary (collapse)

Class Method Details

+ (Object) accepted_encodings



12
13
14
# File 'lib/em-http/decoders.rb', line 12

def accepted_encodings
  DECODERS.inject([]) { |r, d| r + d.encoding_names }
end

+ (Object) decoder_for_encoding(encoding)



16
17
18
19
20
21
# File 'lib/em-http/decoders.rb', line 16

def decoder_for_encoding(encoding)
  DECODERS.each { |d|
    return d if d.encoding_names.include? encoding
  }
  nil
end