Class: Exerb::Win32::Struct::IconHeader

Inherits:
Base
  • Object
show all
Defined in:
lib/exerb/win32/struct/icon_header.rb

Overview

#

Constant Summary collapse

FORMAT =
'SSS'

Instance Attribute Summary collapse

Attributes inherited from Base

#position

Instance Method Summary collapse

Methods inherited from Base

read, #read, #size, #update

Constructor Details

#initializeIconHeader

Returns a new instance of IconHeader.



23
24
25
26
27
# File 'lib/exerb/win32/struct/icon_header.rb', line 23

def initialize
  @reserved = 0
  @type     = 0
  @count    = 0
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



29
30
31
# File 'lib/exerb/win32/struct/icon_header.rb', line 29

def count
  @count
end

#reservedObject

Returns the value of attribute reserved.



29
30
31
# File 'lib/exerb/win32/struct/icon_header.rb', line 29

def reserved
  @reserved
end

#typeObject

Returns the value of attribute type.



29
30
31
# File 'lib/exerb/win32/struct/icon_header.rb', line 29

def type
  @type
end

Instance Method Details

#packObject



31
32
33
# File 'lib/exerb/win32/struct/icon_header.rb', line 31

def pack
  return [@reserved, @type, @count].pack(FORMAT)
end

#unpack(bin) ⇒ Object



35
36
37
38
# File 'lib/exerb/win32/struct/icon_header.rb', line 35

def unpack(bin)
  @reserved, @type, @count = bin.unpack(FORMAT)
  return self
end