Module: HTTPX::Plugins::Compression::OptionsMethods

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

Instance Method Summary collapse

Instance Method Details

#option_compression_threshold_size(value) ⇒ Object

Raises:

  • (TypeError)


31
32
33
34
35
36
# File 'lib/httpx/plugins/compression.rb', line 31

def option_compression_threshold_size(value)
  bytes = Integer(value)
  raise TypeError, ":expect_threshold_size must be positive" unless bytes.positive?

  bytes
end

#option_encodings(value) ⇒ Object

Raises:

  • (TypeError)


38
39
40
41
42
# File 'lib/httpx/plugins/compression.rb', line 38

def option_encodings(value)
  raise TypeError, ":encodings must be a registry" unless value.respond_to?(:registry)

  value
end