Class: ObjCClassTemplate
- Inherits:
-
Mustache
- Object
- Mustache
- ObjCClassTemplate
- Defined in:
- lib/mt_tool/short_hand/objc_generate_from_shorthand.rb
Overview
Instance Attribute Summary collapse
-
#cls ⇒ Object
Returns the value of attribute cls.
-
#shorthand_file ⇒ Object
Returns the value of attribute shorthand_file.
Instance Method Summary collapse
- #class_name ⇒ Object
- #frameworks ⇒ Object
- #imports ⇒ Object
-
#initialize(cls, shorthand_file) ⇒ ObjCClassTemplate
constructor
A new instance of ObjCClassTemplate.
- #ivars ⇒ Object
- #ivars_with_properties ⇒ Object
- #ivars_with_properties_without_ro ⇒ Object
- #ivars_without_properties ⇒ Object
- #ivars_without_properties_or_with_ro ⇒ Object
- #needs_legacy ⇒ Object
- #superclass_name ⇒ Object
Constructor Details
#initialize(cls, shorthand_file) ⇒ ObjCClassTemplate
Returns a new instance of ObjCClassTemplate.
12 13 14 15 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 12 def initialize cls, shorthand_file @cls = cls @shorthand_file = shorthand_file end |
Instance Attribute Details
#cls ⇒ Object
Returns the value of attribute cls.
10 11 12 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 10 def cls @cls end |
#shorthand_file ⇒ Object
Returns the value of attribute shorthand_file.
10 11 12 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 10 def shorthand_file @shorthand_file end |
Instance Method Details
#class_name ⇒ Object
40 41 42 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 40 def class_name @cls.objc_name end |
#frameworks ⇒ Object
32 33 34 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 32 def frameworks @cls.objc_frameworks end |
#imports ⇒ Object
36 37 38 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 36 def imports @cls.objc_imports end |
#ivars ⇒ Object
17 18 19 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 17 def ivars @cls.objc_ivars.map { |name, x| ObjCIvarTemplate.new(x) } end |
#ivars_with_properties ⇒ Object
21 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 21 def ivars_with_properties; ivars; end |
#ivars_with_properties_without_ro ⇒ Object
24 25 26 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 24 def ivars_with_properties_without_ro ivars_with_properties.select { |x| not x.ivar..include? :ro } end |
#ivars_without_properties ⇒ Object
22 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 22 def ivars_without_properties; []; end |
#ivars_without_properties_or_with_ro ⇒ Object
28 29 30 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 28 def ivars_without_properties_or_with_ro ivars_with_properties.select { |x| x.ivar..include? :ro } end |
#needs_legacy ⇒ Object
48 49 50 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 48 def needs_legacy true end |
#superclass_name ⇒ Object
44 45 46 |
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 44 def superclass_name @cls.objc_superclass_name end |