Class: ChunkyPNG::Chunk::Generic

Inherits:
Base
  • Object
show all
Defined in:
lib/chunky_png/chunk.rb

Overview

The Generic chunk type will read the content from the chunk as it, and will write it back as it was read.

Direct Known Subclasses

ImageData, InternationalText, Palette, Transparency

Instance Attribute Summary (collapse)

Attributes inherited from Base

#type

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Base

#write, #write_with_crc

Constructor Details

- (Generic) initialize(type, content = '')



86
87
88
# File 'lib/chunky_png/chunk.rb', line 86

def initialize(type, content = '')
  super(type, :content => content)
end

Instance Attribute Details

- (Object) content

The attribute to store the content from the chunk, which gets written by the write method.



84
85
86
# File 'lib/chunky_png/chunk.rb', line 84

def content
  @content
end

Class Method Details

+ (ChunkyPNG::Chunk::Generic) read(type, content)

Creates an instance, given the chunk's type and content.



94
95
96
# File 'lib/chunky_png/chunk.rb', line 94

def self.read(type, content)
  new(type, content)
end