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
- #hash_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.
179 180 181 182 |
# File 'lib/ObjCGenerator/types.rb', line 179 def initialize( name , type) super(name) @var_type = type end |
Instance Attribute Details
#var_type ⇒ Object
Returns the value of attribute var_type.
178 179 180 |
# File 'lib/ObjCGenerator/types.rb', line 178 def var_type @var_type end |
#varname ⇒ Object
Returns the value of attribute varname.
177 178 179 |
# File 'lib/ObjCGenerator/types.rb', line 177 def varname @varname end |
Instance Method Details
#conversion_value(origin) ⇒ Object
189 190 191 192 |
# File 'lib/ObjCGenerator/types.rb', line 189 def conversion_value origin # "[#{origin} description]" "[[#{var_type} alloc] initWithDict:#{origin}]" end |
#copyrow(newVarName) ⇒ Object
202 203 204 |
# File 'lib/ObjCGenerator/types.rb', line 202 def copyrow newVarName "#{newVarName}.#{self.varname} = [self.#{self.varname} copyWithZone:nil];" end |
#default_value ⇒ Object
186 187 188 |
# File 'lib/ObjCGenerator/types.rb', line 186 def default_value "[#{@var_type} new]" end |
#description_row ⇒ Object
199 200 201 |
# File 'lib/ObjCGenerator/types.rb', line 199 def description_row "@\"self.#{self.varname} = %@\" , self.#{self.varname}" end |
#hash_row ⇒ Object
205 206 207 |
# File 'lib/ObjCGenerator/types.rb', line 205 def hash_row "[self.#{self.varname} hash];" end |
#inEquality_test(other) ⇒ Object
196 197 198 |
# File 'lib/ObjCGenerator/types.rb', line 196 def inEquality_test other "![self.#{self.varname} isEqual:#{other}.#{self.varname}]" end |
#property_definition ⇒ Object
183 184 185 |
# File 'lib/ObjCGenerator/types.rb', line 183 def property_definition "@property (nonatomic) #{@var_type} *#{@varname};" end |
#to_dictionary_item ⇒ Object
193 194 195 |
# File 'lib/ObjCGenerator/types.rb', line 193 def to_dictionary_item "@\"#{@varname}\" : [self.#{@varname} toDict] ?: @{}" end |