class MachO::MachOStructure

A general purpose pseudo-structure. @abstract

Constants

FORMAT

The String#unpack format of the data structure. @return [String] the unpacking format @api private

SIZEOF

The size of the data structure, in bytes. @return [Fixnum] the size, in bytes @api private

Public Class Methods

bytesize() click to toggle source

@return [Fixnum] the size, in bytes, of the represented structure.

# File lib/macho/structure.rb, line 16
def self.bytesize
  self::SIZEOF
end
new_from_bin(endianness, bin) click to toggle source

@param endianness [Symbol] either `:big` or `:little` @param bin [String] the string to be unpacked into the new structure @return [MachO::MachOStructure] the resulting structure @api private

# File lib/macho/structure.rb, line 24
def self.new_from_bin(endianness, bin)
  format = Utils.specialize_format(self::FORMAT, endianness)

  new(*bin.unpack(format))
end