Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/xcode/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#to_xcplistObject

Note:

the keys are represeted in this output with quotes; this is actually optional for certain keys based on their format. This is done to ensure that all keys that do not conform are ensured proper output.

Hashes in an Xcode project take a particular format.

Examples:

output format:


{
  "KEY" = "VALUE";
  "KEY" = "VALUE";
  "KEY" = "VALUE";
}


18
19
20
21
22
23
24
25
26
# File 'lib/xcode/core_ext/hash.rb', line 18

def to_xcplist
  plist_of_items = map do |k,v| 
    "#{k.to_xcplist} = #{v.to_xcplist};"
  end.join("\n")
  
  %{{
    #{plist_of_items}
  }}
end