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



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

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

Instance Method Details

#cpu_nameObject



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

def cpu_name
  @file.cpusubtype
end

#cpu_typeObject



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

def cpu_type
  @file.cputype
end

#headerObject



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

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

#size(human_size: false) ⇒ Object



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

def size(human_size: false)
  return Util.size_to_human_size(@size) if human_size

  @size
end

#to_hObject



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

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

#typeObject



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

def type
  @file.filetype
end

#uuidObject Also known as: debug_id



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

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