Class: ObjCPropertyList
- Inherits:
-
Object
- Object
- ObjCPropertyList
- Defined in:
- lib/ios_generate_settings/ObjCPropertyList.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
- #declaration ⇒ Object
- #implementation ⇒ Object
-
#initialize(args) ⇒ ObjCPropertyList
constructor
A new instance of ObjCPropertyList.
- #loading ⇒ Object
- #print ⇒ Object
- #release ⇒ Object
- #string_const ⇒ Object
Constructor Details
#initialize(args) ⇒ ObjCPropertyList
Returns a new instance of ObjCPropertyList.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ios_generate_settings/ObjCPropertyList.rb', line 5 def initialize(args) self.properties = [] args.each do | arg | args = arg.split ':' if args.count == 2 property = ObjCProperty.new(args[1], args[0]) self.properties << property end end end |
Instance Attribute Details
#properties ⇒ Object
Returns the value of attribute properties.
3 4 5 |
# File 'lib/ios_generate_settings/ObjCPropertyList.rb', line 3 def properties @properties end |
Instance Method Details
#declaration ⇒ Object
22 23 24 25 26 |
# File 'lib/ios_generate_settings/ObjCPropertyList.rb', line 22 def declaration self.properties.map do | property | "#{property.declaration}\n" end.join '' end |
#implementation ⇒ Object
16 17 18 19 20 |
# File 'lib/ios_generate_settings/ObjCPropertyList.rb', line 16 def implementation self.properties.map do | property | "#{property.implementation}\n" end.join '' end |
#loading ⇒ Object
34 35 36 37 38 |
# File 'lib/ios_generate_settings/ObjCPropertyList.rb', line 34 def loading self.properties.map do | property | "#{' '*8}#{property.loading}\n" end.join '' end |
#print ⇒ Object
46 47 48 49 50 51 |
# File 'lib/ios_generate_settings/ObjCPropertyList.rb', line 46 def print printf self.string_const printf self.declaration printf self.implementation printf self.loading end |
#release ⇒ Object
40 41 42 43 44 |
# File 'lib/ios_generate_settings/ObjCPropertyList.rb', line 40 def release self.properties.map do | property | "#{' '*4}#{property.release}\n" end.join '' end |
#string_const ⇒ Object
28 29 30 31 32 |
# File 'lib/ios_generate_settings/ObjCPropertyList.rb', line 28 def string_const self.properties.map do | property | "#{property.string_const}\n" end.join '' end |