Class: AppInfo::DSYM::MachO
Overview
Constant Summary
Helper::HumanFileSize::FILE_SIZE_UNITS
Instance Method Summary
collapse
#file_to_human_size, #number_to_human_size
Constructor Details
#initialize(file, size = 0) ⇒ MachO
Returns a new instance of MachO.
11
12
13
14
|
# File 'lib/app_info/dsym/macho.rb', line 11
def initialize(file, size = 0)
@file = file
@size = size
end
|
Instance Method Details
#cpu_name ⇒ String
17
18
19
|
# File 'lib/app_info/dsym/macho.rb', line 17
def cpu_name
@file.cpusubtype
end
|
#cpu_type ⇒ String
22
23
24
|
# File 'lib/app_info/dsym/macho.rb', line 22
def cpu_type
@file.cputype
end
|
45
46
47
|
# File 'lib/app_info/dsym/macho.rb', line 45
def
@header ||= @file.
end
|
#size(human_size: false) ⇒ String, Integer
32
33
34
35
36
|
# File 'lib/app_info/dsym/macho.rb', line 32
def size(human_size: false)
return number_to_human_size(@size) if human_size
@size
end
|
#to_h ⇒ Hash{Symbol => String, Integer}
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/app_info/dsym/macho.rb', line 50
def to_h
{
uuid: uuid,
type: type,
cpu_name: cpu_name,
cpu_type: cpu_type,
size: size,
human_size: size(human_size: true)
}
end
|
#type ⇒ String
27
28
29
|
# File 'lib/app_info/dsym/macho.rb', line 27
def type
@file.filetype
end
|
#uuid ⇒ String
Also known as:
debug_id
39
40
41
|
# File 'lib/app_info/dsym/macho.rb', line 39
def uuid
@file[:LC_UUID][0].uuid_string
end
|