lib/xcodeproject/pbx_group.rb in xcodeproject-0.1.1 vs lib/xcodeproject/pbx_group.rb in xcodeproject-0.2.3

- old
+ new

@@ -1,17 +1,25 @@ require 'xcodeproject/pbx_file_reference' require 'xcodeproject/exceptions' require 'pathname' -module XCodeProject +module XcodeProject class PBXGroup < FileNode def initialize (root, uuid, data) super(root, uuid, data) @children = data['children'] end def children @children.map {|uuid| root.object!(uuid)} + end + + def groups + children.select {|child| child.is_a?(PBXGroup) } + end + + def files + children.select {|child| child.is_a?(PBXFileReference) } end def child (gpath) gpath = Pathname.new(gpath).cleanpath