class MachO::LoadCommands::UUIDCommand

A load command containing a single 128-bit unique random number identifying an object produced by static link editor. Corresponds to LC_UUID.

Public Instance Methods

to_h() click to toggle source

@return [Hash] returns a hash representation of this {UUIDCommand}

Calls superclass method MachO::LoadCommands::LoadCommand#to_h
# File lib/macho/load_commands.rb, line 412
def to_h
  {
    "uuid" => uuid,
    "uuid_string" => uuid_string,
  }.merge super
end
to_s() click to toggle source

@return [String] an alias for uuid_string

# File lib/macho/load_commands.rb, line 407
def to_s
  uuid_string
end
uuid_string() click to toggle source

@return [String] a string representation of the UUID

# File lib/macho/load_commands.rb, line 396
def uuid_string
  hexes = uuid.map { |elem| "%02<elem>x" % { :elem => elem } }
  segs = [
    hexes[0..3].join, hexes[4..5].join, hexes[6..7].join,
    hexes[8..9].join, hexes[10..15].join
  ]

  segs.join("-")
end