Module: HTTPX::Plugins::Compression::Deflate
- Defined in:
- lib/httpx/plugins/compression/deflate.rb
Defined Under Namespace
Modules: Deflater
Class Method Summary collapse
- .configure(klass) ⇒ Object
- .deflater ⇒ Object
- .extra_options(options) ⇒ Object
- .inflater(bytesize) ⇒ Object
- .load_dependencies(_klass) ⇒ Object
Class Method Details
.configure(klass) ⇒ Object
13 14 15 |
# File 'lib/httpx/plugins/compression/deflate.rb', line 13 def configure(klass) klass.plugin(:"compression/gzip") end |
.deflater ⇒ Object
43 44 45 |
# File 'lib/httpx/plugins/compression/deflate.rb', line 43 def deflater Deflater end |
.extra_options(options) ⇒ Object
17 18 19 |
# File 'lib/httpx/plugins/compression/deflate.rb', line 17 def () .merge(encodings: .encodings.merge("deflate" => self)) end |
.inflater(bytesize) ⇒ Object
47 48 49 |
# File 'lib/httpx/plugins/compression/deflate.rb', line 47 def inflater(bytesize) GZIP::Inflater.new(bytesize) end |
.load_dependencies(_klass) ⇒ Object
8 9 10 11 |
# File 'lib/httpx/plugins/compression/deflate.rb', line 8 def load_dependencies(_klass) require "stringio" require "zlib" end |