Class: Xcode::EnumerationProperty
- Inherits:
-
Object
- Object
- Xcode::EnumerationProperty
- Defined in:
- lib/xcode/configurations/enumeration_property.rb
Instance Attribute Summary collapse
-
#enumeration ⇒ Object
readonly
Returns the value of attribute enumeration.
Instance Method Summary collapse
- #append(original, value) ⇒ Object
-
#initialize(*args) ⇒ EnumerationProperty
constructor
A new instance of EnumerationProperty.
- #open(value) ⇒ Object
- #save(value) ⇒ Object
Constructor Details
#initialize(*args) ⇒ EnumerationProperty
Returns a new instance of EnumerationProperty.
7 8 9 |
# File 'lib/xcode/configurations/enumeration_property.rb', line 7 def initialize(*args) @enumeration = args.flatten.compact end |
Instance Attribute Details
#enumeration ⇒ Object (readonly)
Returns the value of attribute enumeration.
5 6 7 |
# File 'lib/xcode/configurations/enumeration_property.rb', line 5 def enumeration @enumeration end |
Instance Method Details
#append(original, value) ⇒ Object
21 22 23 24 |
# File 'lib/xcode/configurations/enumeration_property.rb', line 21 def append(original,value) warn "Overriding configuration property '#{original}' with new value '#{value}'" unless original == value save(value) end |
#open(value) ⇒ Object
11 12 13 14 |
# File 'lib/xcode/configurations/enumeration_property.rb', line 11 def open(value) warn "Configuration property contains a value '#{value}' not within the enumeration." unless enumeration.include?(value) value end |
#save(value) ⇒ Object
16 17 18 19 |
# File 'lib/xcode/configurations/enumeration_property.rb', line 16 def save(value) raise "Configuration property value specified '#{value}' not within the enumeration." unless enumeration.include?(value) value end |