Class: TypeArray
Overview
A R R A Y ##
Instance Attribute Summary collapse
-
#var_sub_type ⇒ Object
Returns the value of attribute var_sub_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, sub_type) ⇒ TypeArray
constructor
A new instance of TypeArray.
- #property_definition ⇒ Object
- #to_dictionary_item ⇒ Object
Methods inherited from ObjCType
Constructor Details
#initialize(name, sub_type) ⇒ TypeArray
Returns a new instance of TypeArray.
218 219 220 221 222 |
# File 'lib/ObjCGenerator/types.rb', line 218 def initialize( name , sub_type) super(name) @var_sub_type = sub_type end |
Instance Attribute Details
#var_sub_type ⇒ Object
Returns the value of attribute var_sub_type.
217 218 219 |
# File 'lib/ObjCGenerator/types.rb', line 217 def var_sub_type @var_sub_type end |
#varname ⇒ Object
Returns the value of attribute varname.
216 217 218 |
# File 'lib/ObjCGenerator/types.rb', line 216 def varname @varname end |
Instance Method Details
#conversion_value(origin) ⇒ Object
230 231 232 |
# File 'lib/ObjCGenerator/types.rb', line 230 def conversion_value origin "[NSArray arrayWithArray:#{origin}]" end |
#copyrow(newVarName) ⇒ Object
242 243 244 |
# File 'lib/ObjCGenerator/types.rb', line 242 def copyrow newVarName "#{newVarName}.#{self.varname} = [self.#{self.varname} copyWithZone:nil];" end |
#default_value ⇒ Object
227 228 229 |
# File 'lib/ObjCGenerator/types.rb', line 227 def default_value "@[]" end |
#description_row ⇒ Object
239 240 241 |
# File 'lib/ObjCGenerator/types.rb', line 239 def description_row "@\"self.#{self.varname} = %@\" , self.#{self.varname}" end |
#inEquality_test(other) ⇒ Object
236 237 238 |
# File 'lib/ObjCGenerator/types.rb', line 236 def inEquality_test other "![self.#{self.varname} isEqual:#{other}.#{self.varname}]" end |
#property_definition ⇒ Object
224 225 226 |
# File 'lib/ObjCGenerator/types.rb', line 224 def property_definition "@property (nonatomic) NSArray *#{@varname}; //@[#{var_sub_type}]" end |
#to_dictionary_item ⇒ Object
233 234 235 |
# File 'lib/ObjCGenerator/types.rb', line 233 def to_dictionary_item "@\"#{@varname}\" : self.#{@varname} ?: @[]" end |