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.



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

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

Instance Method Details

#cpu_nameObject



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

def cpu_name
  @file.cpusubtype
end

#cpu_typeObject



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

def cpu_type
  @file.cputype
end

#headerObject



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

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

#size(humanable = false) ⇒ Object



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

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

  @size
end

#to_hObject



138
139
140
141
142
143
144
145
146
147
# File 'lib/app_info/dsym.rb', line 138

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

#typeObject



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

def type
  @file.filetype
end

#uuidObject Also known as: debug_id



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

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