Class: ObjCClassTemplate

Inherits:
Mustache
  • Object
show all
Defined in:
lib/mt_tool/short_hand/objc_generate_from_shorthand.rb

Overview


Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clsObject

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_fileObject

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_nameObject



40
41
42
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 40

def class_name
	@cls.objc_name
end

#frameworksObject



32
33
34
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 32

def frameworks
	@cls.objc_frameworks
end

#importsObject



36
37
38
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 36

def imports
	@cls.objc_imports
end

#ivarsObject



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_propertiesObject



21
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 21

def ivars_with_properties; ivars; end

#ivars_with_properties_without_roObject



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.options.include? :ro }
end

#ivars_without_propertiesObject



22
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 22

def ivars_without_properties; []; end

#ivars_without_properties_or_with_roObject



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.options.include? :ro }
end

#needs_legacyObject



48
49
50
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 48

def needs_legacy
	true
end

#superclass_nameObject



44
45
46
# File 'lib/mt_tool/short_hand/objc_generate_from_shorthand.rb', line 44

def superclass_name
	@cls.objc_superclass_name
end