Class: Huff::EncodingTableBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/huff/encoding_table_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ EncodingTableBuilder

Returns a new instance of EncodingTableBuilder.



3
4
5
# File 'lib/huff/encoding_table_builder.rb', line 3

def initialize(tree)
  @tree = tree
end

Instance Method Details

#tableObject



7
8
9
# File 'lib/huff/encoding_table_builder.rb', line 7

def table
  Hash[create_table(@tree, '')]
end