Method: MachO::FatFile#initialize

Defined in:
lib/macho/fat_file.rb

#initialize(filename, **opts) ⇒ FatFile

Note:

see MachOFile#initialize for currently valid options

Creates a new FatFile from the given filename.

Parameters:

  • filename (String)

    the fat file to load from

  • opts (Hash)

    options to control the parser with

Raises:

  • (ArgumentError)

    if the given file does not exist



94
95
96
97
98
99
100
101
# File 'lib/macho/fat_file.rb', line 94

def initialize(filename, **opts)
  raise ArgumentError, "#{filename}: no such file" unless File.file?(filename)

  @filename = filename
  @options = opts
  @raw_data = File.binread(@filename)
  populate_fields
end