Class: MachO::MachOStructure Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/macho/structure.rb

Overview

This class is abstract.

A general purpose pseudo-structure.

Direct Known Subclasses

LoadCommand, Section, Section64

Class Method Summary collapse

Class Method Details

.bytesizeFixnum

Returns the size, in bytes, of the represented structure.

Returns:

  • (Fixnum)

    the size, in bytes, of the represented structure.



10
11
12
# File 'lib/macho/structure.rb', line 10

def self.bytesize
  @sizeof
end

.new_from_bin(bin) ⇒ MachO::MachOStructure

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new MachOStructure initialized with ‘bin`.

Returns:



16
17
18
# File 'lib/macho/structure.rb', line 16

def self.new_from_bin(bin)
  self.new(*bin.unpack(@format))
end