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

Constant Summary collapse

DECODERS =
[Deflate, GZip]

Class Method Summary collapse

Class Method Details

.accepted_encodingsObject



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

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

.decoder_for_encoding(encoding) ⇒ Object



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

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