Method: HTTP2::Header::EncodingContext#initialize

Defined in:
lib/http/2/compressor.rb

#initialize(**options) ⇒ EncodingContext

Initializes compression context with appropriate client/server defaults and maximum size of the dynamic table.

Parameters:

  • options (Hash)

    encoding options :table_size Integer maximum dynamic table size in bytes :huffman Symbol :always, :never, :shorter :index Symbol :all, :static, :never



97
98
99
100
101
102
103
104
105
106
# File 'lib/http/2/compressor.rb', line 97

def initialize(**options)
  default_options = {
    huffman:    :shorter,
    index:      :all,
    table_size: 4096,
  }
  @table = []
  @options = default_options.merge(options)
  @limit = @options[:table_size]
end