Class: XcodeProject::PBXBuildFile

Inherits:
Node
  • Object
show all
Defined in:
lib/xcodeproject/pbx_build_file.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#isa, #uuid

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, uuid, data) ⇒ PBXBuildFile

Returns a new instance of PBXBuildFile.



7
8
9
10
11
# File 'lib/xcodeproject/pbx_build_file.rb', line 7

def initialize (root, uuid, data)
  super(root, uuid, data)

  @file_ref = data['fileRef']
end

Instance Attribute Details

#file_refObject (readonly)

Returns the value of attribute file_ref.



5
6
7
# File 'lib/xcodeproject/pbx_build_file.rb', line 5

def file_ref
  @file_ref
end

Class Method Details

.add(root, file_ref_uuid) ⇒ Object



22
23
24
25
# File 'lib/xcodeproject/pbx_build_file.rb', line 22

def self.add(root, file_ref_uuid)
  uuid, data = root.add_object(self.create_object_hash(file_ref_uuid)) 
  self.new(root, uuid, data)
end

.create_object_hash(file_ref_uuid) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/xcodeproject/pbx_build_file.rb', line 29

def self.create_object_hash (file_ref_uuid)
  data = []
  data << ['isa', 'PBXBuildFile']
  data << ['fileRef', file_ref_uuid]
  
  Hash[ data ]
end

Instance Method Details

#remove!Object



17
18
19
20
# File 'lib/xcodeproject/pbx_build_file.rb', line 17

def remove!
  root.project.targets.each {|target| target.remove_source(self) }
  root.remove_object(uuid)
end