Class: ChunkyPNG::Chunk::Generic
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
Instance Attribute Summary collapse
-
#content ⇒ Object
The attribute to store the content from the chunk, which gets written by the
write
method.
Attributes inherited from Base
Class Method Summary collapse
-
.read(type, content) ⇒ ChunkyPNG::Chunk::Generic
Creates an instance, given the chunk’s type and content.
Instance Method Summary collapse
-
#initialize(type, content = "") ⇒ Generic
constructor
A new instance of Generic.
Methods inherited from Base
Constructor Details
#initialize(type, content = "") ⇒ Generic
Returns a new instance of Generic.
100 101 102 |
# File 'lib/chunky_png/chunk.rb', line 100 def initialize(type, content = "") super(type, content: content) end |
Instance Attribute Details
#content ⇒ Object
The attribute to store the content from the chunk, which gets written by the write
method.
98 99 100 |
# File 'lib/chunky_png/chunk.rb', line 98 def content @content end |
Class Method Details
.read(type, content) ⇒ ChunkyPNG::Chunk::Generic
Creates an instance, given the chunk’s type and content.
108 109 110 |
# File 'lib/chunky_png/chunk.rb', line 108 def self.read(type, content) new(type, content) end |