Class: TypeCustomObject
Instance Attribute Summary collapse
-
#var_type ⇒ Object
Returns the value of attribute var_type.
-
#varname ⇒ Object
Returns the value of attribute varname.
Instance Method Summary collapse
- #conversion_value(origin) ⇒ Object
- #copyrow(newVarName) ⇒ Object
- #default_value ⇒ Object
- #description_row ⇒ Object
- #inEquality_test(other) ⇒ Object
-
#initialize(name, type) ⇒ TypeCustomObject
constructor
A new instance of TypeCustomObject.
- #property_definition ⇒ Object
- #to_dictionary_item ⇒ Object
Constructor Details
#initialize(name, type) ⇒ TypeCustomObject
Returns a new instance of TypeCustomObject.
160 161 162 163 |
# File 'lib/ObjCGenerator/types.rb', line 160 def initialize( name , type) super(name) @var_type = type end |
Instance Attribute Details
#var_type ⇒ Object
Returns the value of attribute var_type.
159 160 161 |
# File 'lib/ObjCGenerator/types.rb', line 159 def var_type @var_type end |
#varname ⇒ Object
Returns the value of attribute varname.
158 159 160 |
# File 'lib/ObjCGenerator/types.rb', line 158 def varname @varname end |
Instance Method Details
#conversion_value(origin) ⇒ Object
170 171 172 173 |
# File 'lib/ObjCGenerator/types.rb', line 170 def conversion_value origin # "[#{origin} description]" "[[SampleClass2 alloc] initWithDict:#{origin}]" end |
#copyrow(newVarName) ⇒ Object
183 184 185 |
# File 'lib/ObjCGenerator/types.rb', line 183 def copyrow newVarName "#{newVarName}.#{self.varname} = [self.#{self.varname} copyWithZone:nil];" end |
#default_value ⇒ Object
167 168 169 |
# File 'lib/ObjCGenerator/types.rb', line 167 def default_value "[#{@var_type} new]" end |
#description_row ⇒ Object
180 181 182 |
# File 'lib/ObjCGenerator/types.rb', line 180 def description_row "@\"self.#{self.varname} = %@\" , self.#{self.varname}" end |
#inEquality_test(other) ⇒ Object
177 178 179 |
# File 'lib/ObjCGenerator/types.rb', line 177 def inEquality_test other "![self.#{self.varname} isEqual:#{other}.#{self.varname}]" end |
#property_definition ⇒ Object
164 165 166 |
# File 'lib/ObjCGenerator/types.rb', line 164 def property_definition "@property (nonatomic) #{@var_type} *#{@varname};" end |
#to_dictionary_item ⇒ Object
174 175 176 |
# File 'lib/ObjCGenerator/types.rb', line 174 def to_dictionary_item "@\"#{@varname}\" : [self.#{@varname} toDict] ?: @{}" end |