Class: Exerb::Win32::ResourceEntry::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/exerb/win32/resource_entry.rb

Overview

#

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Data


66
67
68
# File 'lib/exerb/win32/resource_entry.rb', line 66

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data


70
71
72
# File 'lib/exerb/win32/resource_entry.rb', line 70

def data
  @data
end

Class Method Details

.read(io, base, size) ⇒ Object


72
73
74
# File 'lib/exerb/win32/resource_entry.rb', line 72

def self.read(io, base, size)
  return self.new(nil).read(io, base, size)
end

Instance Method Details

#pack(table, reloc, base) ⇒ Object


82
83
84
# File 'lib/exerb/win32/resource_entry.rb', line 82

def pack(table, reloc, base)
  return Exerb::Utility.alignment16(@data)
end

#read(io, base, size) ⇒ Object


90
91
92
93
# File 'lib/exerb/win32/resource_entry.rb', line 90

def read(io, base, size)
  @data = io.read(size)
  return self
end

#serialize(elements, level) ⇒ Object


76
77
78
79
80
# File 'lib/exerb/win32/resource_entry.rb', line 76

def serialize(elements, level)
  elements[2][level] = [] if elements[2][level].nil?
  elements[2][level] << self
  return elements
end

#sizeObject


86
87
88
# File 'lib/exerb/win32/resource_entry.rb', line 86

def size
  return @data.size
end