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.



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

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.



27
28
29
# File 'lib/xcodeproject/pbx_build_file.rb', line 27

def file_ref
  @file_ref
end

Class Method Details

.add(root, file_ref_uuid) ⇒ Object



44
45
46
47
# File 'lib/xcodeproject/pbx_build_file.rb', line 44

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

Instance Method Details

#remove!Object



39
40
41
42
# File 'lib/xcodeproject/pbx_build_file.rb', line 39

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