Class: ZergXcode::Objects::PBXGroup
- Inherits:
-
XcodeObject
show all
- Defined in:
- lib/zerg_xcode/objects/pbx_group.rb
Overview
A group of files (shown as a folder) in an Xcode project.
Instance Attribute Summary
Attributes inherited from XcodeObject
#archive_id, #version
Instance Method Summary
(collapse)
Methods inherited from XcodeObject
#[], #[]=, #_attr_hash, #attrs, #copy_metadata, from, #initialize, #isa, new, #shallow_copy, #visit, #visit_array, #visit_hash, #visit_once, #visit_value, #xref_key, #xref_name
Instance Method Details
- (Object) children
26
27
28
|
# File 'lib/zerg_xcode/objects/pbx_group.rb', line 26
def children
self['children']
end
|
- (Object) create_group(path_name, group_name = nil, source_tree = '<group>')
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/zerg_xcode/objects/pbx_group.rb', line 30
def create_group(path_name, group_name=nil, source_tree='<group>')
group_name = group_name || path_name
unless group = find_group_named(group_name)
group = ZergXcode::Objects::PBXGroup.new 'name' => group_name,
'path' => path_name,
'children' => [],
'sourceTree' => source_tree
self.children << group
end
group
end
|
- (Object) find_group_named(group_name)
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/zerg_xcode/objects/pbx_group.rb', line 13
def find_group_named(group_name)
self['children'].each do |child|
if child.isa == :PBXGroup
if child.xref_name == group_name
return child
elsif grandchild = child.find_group_named(group_name)
return grandchild
end
end
end
return nil
end
|
- (Object) to_s
42
43
44
|
# File 'lib/zerg_xcode/objects/pbx_group.rb', line 42
def to_s
"PBXGroup<#{xref_name}>"
end
|