Class: MachO::LoadCommands::LoadCommand::SerializationContext
- Inherits:
-
Object
- Object
- MachO::LoadCommands::LoadCommand::SerializationContext
- Defined in:
- lib/macho/load_commands.rb
Overview
Represents the contextual information needed by a load command to serialize itself correctly into a binary string.
Instance Attribute Summary collapse
-
#alignment ⇒ Integer
readonly
The constant alignment value used to pad the serialized load command.
-
#endianness ⇒ Symbol
readonly
The endianness of the serialized load command.
Class Method Summary collapse
-
.context_for(macho) ⇒ SerializationContext
The resulting context.
Instance Method Summary collapse
-
#initialize(endianness, alignment) ⇒ SerializationContext
constructor
private
A new instance of SerializationContext.
Constructor Details
#initialize(endianness, alignment) ⇒ SerializationContext
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 SerializationContext.
381 382 383 384 |
# File 'lib/macho/load_commands.rb', line 381 def initialize(endianness, alignment) @endianness = endianness @alignment = alignment end |
Instance Attribute Details
#alignment ⇒ Integer (readonly)
Returns the constant alignment value used to pad the serialized load command.
369 370 371 |
# File 'lib/macho/load_commands.rb', line 369 def alignment @alignment end |
#endianness ⇒ Symbol (readonly)
Returns the endianness of the serialized load command.
365 366 367 |
# File 'lib/macho/load_commands.rb', line 365 def endianness @endianness end |
Class Method Details
.context_for(macho) ⇒ SerializationContext
Returns the resulting context.
374 375 376 |
# File 'lib/macho/load_commands.rb', line 374 def self.context_for(macho) new(macho.endianness, macho.alignment) end |