Module: HTTPX::Plugins::Brotli

Defined in:
lib/httpx/plugins/brotli.rb

Defined Under Namespace

Modules: RequestBodyClassMethods, ResponseBodyClassMethods Classes: Deflater

Class Method Summary collapse

Class Method Details

.decode(_response) ⇒ Object



44
45
46
# File 'lib/httpx/plugins/brotli.rb', line 44

def decode(_response, **)
  ::Brotli.method(:inflate)
end

.encode(body) ⇒ Object



40
41
42
# File 'lib/httpx/plugins/brotli.rb', line 40

def encode(body)
  Deflater.new(body)
end

.extra_options(options) ⇒ Object



36
37
38
# File 'lib/httpx/plugins/brotli.rb', line 36

def self.extra_options(options)
  options.merge(supported_compression_formats: %w[br] + options.supported_compression_formats)
end

.load_dependenciesObject



32
33
34
# File 'lib/httpx/plugins/brotli.rb', line 32

def load_dependencies(*)
  require "brotli"
end