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)


28
29
30
31
32
33
# File 'lib/httpx/plugins/compression.rb', line 28

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

  bytes
end

#option_encodings(value) ⇒ Object

Raises:

  • (TypeError)


35
36
37
38
39
# File 'lib/httpx/plugins/compression.rb', line 35

def option_encodings(value)
  raise TypeError, ":encodings must be an Hash" unless value.is_a?(Hash)

  value
end