Class: MachO::LoadCommands::SubLibraryCommand

Inherits:
LoadCommand show all
Defined in:
lib/macho/load_commands.rb

Overview

A load command signifying a sublibrary of a shared library. Corresponds to LC_SUB_LIBRARY.

Constant Summary collapse

FORMAT =

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

"L=3"
SIZEOF =

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

12

Instance Attribute Summary collapse

Attributes inherited from LoadCommand

#cmd, #cmdsize, #view

Instance Method Summary collapse

Methods inherited from LoadCommand

create, new_from_bin, #offset, #serializable?, #serialize, #to_s, #type

Methods inherited from MachOStructure

bytesize, new_from_bin

Constructor Details

#initialize(view, cmd, cmdsize, sub_library) ⇒ SubLibraryCommand

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 instance of SubLibraryCommand.



846
847
848
849
# File 'lib/macho/load_commands.rb', line 846

def initialize(view, cmd, cmdsize, sub_library)
  super(view, cmd, cmdsize)
  @sub_library = LCStr.new(self, sub_library)
end

Instance Attribute Details

#sub_libraryLCStr (readonly)

Returns the sublibrary name as an LCStr.

Returns:

  • (LCStr)

    the sublibrary name as an LCStr



835
836
837
# File 'lib/macho/load_commands.rb', line 835

def sub_library
  @sub_library
end

Instance Method Details

#to_hHash

Returns a hash representation of this MachO::LoadCommands::SubLibraryCommand.

Returns:



852
853
854
855
856
# File 'lib/macho/load_commands.rb', line 852

def to_h
  {
    "sub_library" => sub_library.to_h,
  }.merge super
end