Class: AppInfo::DSYM::MachO

Inherits:
Object show all
Defined in:
lib/app_info/dsym.rb

Overview

DSYM Mach-O

Instance Method Summary collapse

Constructor Details

#initialize(file, size = 0) ⇒ MachO

Returns a new instance of MachO.



103
104
105
106
# File 'lib/app_info/dsym.rb', line 103

def initialize(file, size = 0)
  @file = file
  @size = size
end

Instance Method Details

#cpu_nameObject



108
109
110
# File 'lib/app_info/dsym.rb', line 108

def cpu_name
  @file.cpusubtype
end

#cpu_typeObject



112
113
114
# File 'lib/app_info/dsym.rb', line 112

def cpu_type
  @file.cputype
end

#headerObject



131
132
133
# File 'lib/app_info/dsym.rb', line 131

def header
  @header ||= @file.header
end

#size(humanable = false) ⇒ Object



120
121
122
123
124
# File 'lib/app_info/dsym.rb', line 120

def size(humanable = false)
  return Util.size_to_humanable(@size) if humanable

  @size
end

#to_hObject



135
136
137
138
139
140
141
142
143
144
# File 'lib/app_info/dsym.rb', line 135

def to_h
  {
    uuid: uuid,
    type: type,
    cpu_name: cpu_name,
    cpu_type: cpu_type,
    size: size,
    humanable_size: size(true)
  }
end

#typeObject



116
117
118
# File 'lib/app_info/dsym.rb', line 116

def type
  @file.filetype
end

#uuidObject Also known as: debug_id



126
127
128
# File 'lib/app_info/dsym.rb', line 126

def uuid
  @file[:LC_UUID][0].uuid_string
end