Class: PDF::Reader::LZW::StringTable
- Inherits:
-
Hash
- Object
- ObjectHash
- Hash
- PDF::Reader::LZW::StringTable
- Defined in:
- lib/pdf/reader/lzw.rb
Overview
stores de pairs code => string
Constant Summary
Constants inherited from ObjectHash
Instance Attribute Summary collapse
-
#string_table_pos ⇒ Object
readonly
:nodoc:.
Attributes inherited from ObjectHash
#default, #pdf_version, #trailer
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.
Methods inherited from Hash
Methods inherited from ObjectHash
#cacheable?, #each, #each_key, #each_value, #empty?, #fetch, #has_key?, #has_value?, #keys, #obj_type, #object, #page_references, #size, #stream?, #to_a, #to_s, #values, #values_at
Constructor Details
#initialize ⇒ StringTable
Returns a new instance of StringTable.
64 65 66 67 |
# File 'lib/pdf/reader/lzw.rb', line 64 def initialize super @string_table_pos = 258 #initial code end |
Instance Attribute Details
#string_table_pos ⇒ Object (readonly)
:nodoc:
62 63 64 |
# File 'lib/pdf/reader/lzw.rb', line 62 def string_table_pos @string_table_pos end |
Instance Method Details
#[](key) ⇒ Object
if code less than 258 return fixed string
70 71 72 |
# File 'lib/pdf/reader/lzw.rb', line 70 def [](key) if key > 257 then super else key.chr end end |
#add(string) ⇒ Object
74 75 76 77 |
# File 'lib/pdf/reader/lzw.rb', line 74 def add(string) store(@string_table_pos, string) @string_table_pos += 1 end |