Class: XCCache::SPM::Package::Product
Constant Summary
Constants inherited
from BaseObject
BaseObject::ATTRS
Instance Attribute Summary
#path, #raw
Instance Method Summary
collapse
Methods included from Cacheable
#__cacheable_module_name, #cacheable, included
Methods inherited from BaseObject
#cast_to, #display_name, #fetch, #full_name, #inspect, #name, #pkg_desc_of, #pkg_name, #pkg_slug, #src_dir, #to_s
#config
#load, #save
#[], #[]=, #initialize, #load, #merge!, #reload, #save
Instance Method Details
#flatten_as_targets ⇒ Object
14
15
16
|
# File 'lib/xccache/spm/desc/product.rb', line 14
def flatten_as_targets
targets
end
|
#library? ⇒ Boolean
22
23
24
|
# File 'lib/xccache/spm/desc/product.rb', line 22
def library?
type == :library
end
|
#recursive_targets(platform: nil) ⇒ Object
30
31
32
|
# File 'lib/xccache/spm/desc/product.rb', line 30
def recursive_targets(platform: nil)
targets + targets.flat_map { |t| t.recursive_targets(platform: platform) }.uniq
end
|
#target_names ⇒ Object
10
11
12
|
# File 'lib/xccache/spm/desc/product.rb', line 10
def target_names
raw["targets"]
end
|
#targets ⇒ Object
18
19
20
|
# File 'lib/xccache/spm/desc/product.rb', line 18
def targets
@targets ||= root.targets.select { |t| target_names.include?(t.name) }
end
|
#type ⇒ Object
26
27
28
|
# File 'lib/xccache/spm/desc/product.rb', line 26
def type
@type ||= raw["type"].keys.first.to_sym
end
|