Class: PDF::Reader::LZW::StringTable
- Inherits:
-
Hash
- Object
- Hash
- PDF::Reader::LZW::StringTable
- Defined in:
- lib/pdf/reader/lzw.rb
Overview
stores de pairs code => string
Instance Attribute Summary collapse
-
#string_table_pos ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#[](key) ⇒ Object
if code less than 258 return fixed string.
- #add(string) ⇒ Object
-
#initialize ⇒ StringTable
constructor
A new instance of StringTable.
Constructor Details
#initialize ⇒ StringTable
Returns a new instance of StringTable.
67 68 69 70 |
# File 'lib/pdf/reader/lzw.rb', line 67 def initialize super @string_table_pos = 258 #initial code end |
Instance Attribute Details
#string_table_pos ⇒ Object (readonly)
:nodoc:
65 66 67 |
# File 'lib/pdf/reader/lzw.rb', line 65 def string_table_pos @string_table_pos end |
Instance Method Details
#[](key) ⇒ Object
if code less than 258 return fixed string
73 74 75 |
# File 'lib/pdf/reader/lzw.rb', line 73 def [](key) if key > 257 then super else key.chr end end |
#add(string) ⇒ Object
77 78 79 80 |
# File 'lib/pdf/reader/lzw.rb', line 77 def add(string) store(@string_table_pos, string) @string_table_pos += 1 end |