Class: Ovaltine::XcodeProject::PBXObject
- Defined in:
- lib/ovaltine/xcode_project/pbxobject.rb
Direct Known Subclasses
PBXContainerItemProxy, PBXFileReference, PBXFrameworksBuildPhase, PBXGroup, PBXNativeTarget, PBXProject, PBXReferenceProxy, PBXResourcesBuildPhase, PBXSourcesBuildPhase, XCBuildConfiguration
Instance Attribute Summary collapse
-
#project_file ⇒ Object
Returns the value of attribute project_file.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(uuid, hash) ⇒ PBXObject
constructor
A new instance of PBXObject.
- #inspect ⇒ Object
Methods inherited from Hash
Constructor Details
#initialize(uuid, hash) ⇒ PBXObject
Returns a new instance of PBXObject.
20 21 22 23 24 25 |
# File 'lib/ovaltine/xcode_project/pbxobject.rb', line 20 def initialize uuid, hash @project = nil @uuid = uuid self["isa"] = self.class.to_s.split('::').last hash.each { |k,v| self[k] = v } end |
Instance Attribute Details
#project_file ⇒ Object
Returns the value of attribute project_file.
5 6 7 |
# File 'lib/ovaltine/xcode_project/pbxobject.rb', line 5 def project_file @project_file end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
6 7 8 |
# File 'lib/ovaltine/xcode_project/pbxobject.rb', line 6 def uuid @uuid end |
Class Method Details
.create_uuid ⇒ Object
14 15 16 17 18 |
# File 'lib/ovaltine/xcode_project/pbxobject.rb', line 14 def self.create_uuid uuid = "" 24.times { uuid += "0123456789ABCDEF"[rand(16),1] } uuid end |
.filter(array, attrs) ⇒ Object
8 9 10 11 12 |
# File 'lib/ovaltine/xcode_project/pbxobject.rb', line 8 def self.filter array, attrs array.select do |obj| attrs.select { |k,v| obj[k] == v }.length == attrs.length end end |
Instance Method Details
#inspect ⇒ Object
27 28 29 |
# File 'lib/ovaltine/xcode_project/pbxobject.rb', line 27 def inspect @uuid + "=" + super end |