Class: PAKFile::Header
- Inherits:
-
Object
- Object
- PAKFile::Header
- Defined in:
- lib/pakspy.rb
Overview
Reperesents PAK header block
Instance Attribute Summary collapse
-
#magic ⇒ Object
Returns the value of attribute magic.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(header) ⇒ Header
constructor
Unpacks the 12 header bytes from
entry
.
Constructor Details
#initialize(header) ⇒ Header
Unpacks the 12 header bytes from entry
161 162 163 164 165 166 167 168 169 170 |
# File 'lib/pakspy.rb', line 161 def initialize(header) # magic - 4 byte arbitary string (not null terminated) # offset - 4 byte integer (little endian) # size - 4 byte integer (little endian) data = header.unpack "a4VV" @magic = data[0] @offset = data[1] @size = data[2] end |
Instance Attribute Details
#magic ⇒ Object
Returns the value of attribute magic.
157 158 159 |
# File 'lib/pakspy.rb', line 157 def magic @magic end |
#offset ⇒ Object
Returns the value of attribute offset.
157 158 159 |
# File 'lib/pakspy.rb', line 157 def offset @offset end |
#size ⇒ Object
Returns the value of attribute size.
157 158 159 |
# File 'lib/pakspy.rb', line 157 def size @size end |