Module: Xcode::Configuration::TargetedDeviceFamily
- Extended by:
- TargetedDeviceFamily
- Included in:
- TargetedDeviceFamily
- Defined in:
- lib/xcode/configurations/targeted_device_family_property.rb
Overview
Within the a build settings there is a setting for the Targeted Device Family which assigns particular numeric values to the platform types.
Instead of manipulating the numeric values, this will perform a conversion return an array of symbols with the platforms like :iphone and :ipad.
Instance Method Summary collapse
- #append(original, value) ⇒ Object
-
#open(value) ⇒ Array<Symbol>
The platform names supported.
-
#save(value) ⇒ String
The comma-delimited list of numeric values representing the platforms.
Instance Method Details
#append(original, value) ⇒ Object
42 43 44 |
# File 'lib/xcode/configurations/targeted_device_family_property.rb', line 42 def append(original,value) save(open(original) + Array(value)) end |
#open(value) ⇒ Array<Symbol>
Returns the platform names supported.
19 20 21 22 23 |
# File 'lib/xcode/configurations/targeted_device_family_property.rb', line 19 def open(value) value.to_s.split(",").map do |platform_number| platforms[platform_number] end end |
#save(value) ⇒ String
Returns the comma-delimited list of numeric values representing the platforms.
30 31 32 33 34 |
# File 'lib/xcode/configurations/targeted_device_family_property.rb', line 30 def save(value) Array(value).map do |platform_name| platforms.map {|number,name| number if name.to_s == platform_name.to_s.downcase } end.flatten.compact.uniq.join(",") end |