Class: PBXObject
Direct Known Subclasses
PBXBuildFile, PBXBuildPhase, PBXFileReference, PBXGroup, PBXNativeTarget, PBXProject, XCBuildConfiguration, XCConfigurationList
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
- #help ⇒ Object
-
#initialize(hash = {}, uuid = "") ⇒ PBXObject
constructor
A new instance of PBXObject.
- #inspect ⇒ Object
Methods inherited from Hash
Constructor Details
#initialize(hash = {}, uuid = "") ⇒ PBXObject
Returns a new instance of PBXObject.
37 38 39 40 41 42 43 44 45 |
# File 'lib/pbxplorer.rb', line 37 def initialize hash={}, uuid="" 24.times { uuid += "0123456789ABCDEF"[rand(16),1] } if uuid.empty? @project = nil @uuid = uuid self.merge! hash self["isa"] ||= self.class.to_s end |
Instance Attribute Details
#project_file ⇒ Object
Returns the value of attribute project_file.
22 23 24 |
# File 'lib/pbxplorer.rb', line 22 def project_file @project_file end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
23 24 25 |
# File 'lib/pbxplorer.rb', line 23 def uuid @uuid end |
Class Method Details
.filter(objs, attrs) ⇒ Object
25 26 27 28 29 |
# File 'lib/pbxplorer.rb', line 25 def self.filter objs, attrs objs.select do |obj| attrs.select { |key, val| obj[key] == val }.length == attrs.length end end |
.objects_of_class(objs, attrs = nil) ⇒ Object
31 32 33 34 35 |
# File 'lib/pbxplorer.rb', line 31 def self.objects_of_class objs, attrs=nil objs = objs.select { |obj| obj.class <= self } objs = self.filter(objs, attrs) if attrs objs end |
Instance Method Details
#help ⇒ Object
52 53 54 |
# File 'lib/pbxplorer.rb', line 52 def help puts "(no help available)" end |
#inspect ⇒ Object
47 48 49 50 |
# File 'lib/pbxplorer.rb', line 47 def inspect props = self.map { |key, val| " #{key} = #{val.inspect}\n" } "#{@uuid} = {\n#{props.join}}" end |