Class: Hpack::Decoder

Inherits:
Object
  • Object
show all
Defined in:
lib/hpack/decoder.rb

Defined Under Namespace

Classes: DecodingError, ZeroIndexedFieldIndex

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lookup_table_size: LookupTable::SETTINGS_HEADER_TABLE_SIZE) ⇒ Decoder

Returns a new instance of Decoder.



8
9
10
# File 'lib/hpack/decoder.rb', line 8

def initialize lookup_table_size: LookupTable::SETTINGS_HEADER_TABLE_SIZE
  @lookup_table = LookupTable.new max_size: lookup_table_size
end

Instance Attribute Details

#lookup_tableObject (readonly)

Returns the value of attribute lookup_table.



6
7
8
# File 'lib/hpack/decoder.rb', line 6

def lookup_table
  @lookup_table
end

Instance Method Details

#decode(input) ⇒ Object



12
13
14
15
16
# File 'lib/hpack/decoder.rb', line 12

def decode input
  read_fields_from input do |field|
    yield field.header, field.value, field
  end
end