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.



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

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

Instance Method Details

#cpu_nameObject



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

def cpu_name
  @file.cpusubtype
end

#cpu_typeObject



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

def cpu_type
  @file.cputype
end

#headerObject



144
145
146
# File 'lib/app_info/dsym.rb', line 144

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

#size(humanable = false) ⇒ Object



133
134
135
136
137
# File 'lib/app_info/dsym.rb', line 133

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

  @size
end

#to_hObject



148
149
150
151
152
153
154
155
156
157
# File 'lib/app_info/dsym.rb', line 148

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

#typeObject



129
130
131
# File 'lib/app_info/dsym.rb', line 129

def type
  @file.filetype
end

#uuidObject Also known as: debug_id



139
140
141
# File 'lib/app_info/dsym.rb', line 139

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