Class: ZPNG::Chunk::ZTXT

Inherits:
TextChunk show all
Defined in:
lib/zpng/text_chunk.rb

Constant Summary

Constants inherited from TextChunk

TextChunk::INTEGER_CLASS

Constants inherited from ZPNG::Chunk

KNOWN_TYPES, VALID_SIZE_RANGE

Instance Attribute Summary collapse

Attributes inherited from TextChunk

#keyword, #text

Attributes inherited from ZPNG::Chunk

#crc, #data, #idx, #offset, #size, #type

Instance Method Summary collapse

Methods inherited from TextChunk

#inspect, #to_hash

Methods inherited from ZPNG::Chunk

#check, #crc_ok?, #export, #export_data, #fix_crc!, from_stream, #inspect, #valid?

Methods included from DeepCopyable

#deep_copy

Constructor Details

#initialize(*args) ⇒ ZTXT

Returns a new instance of ZTXT.



44
45
46
47
48
49
50
51
# File 'lib/zpng/text_chunk.rb', line 44

def initialize *args
  super
  @keyword,@cmethod,@text = data.unpack('Z*Ca*')
  # current only @cmethod value is 0 - deflate
  if @text
    @text = Zlib::Inflate.inflate(@text)
  end
end

Instance Attribute Details

#cmethodObject

compression method



43
44
45
# File 'lib/zpng/text_chunk.rb', line 43

def cmethod
  @cmethod
end