Class: TypeArray

Inherits:
ObjCType show all
Defined in:
lib/ObjCGenerator/types.rb

Overview

A R R A Y ##

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ObjCType

#hash_row

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_typeObject

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

#varnameObject

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_valueObject



227
228
229
# File 'lib/ObjCGenerator/types.rb', line 227

def default_value
  "@[]"
end

#description_rowObject



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_definitionObject



224
225
226
# File 'lib/ObjCGenerator/types.rb', line 224

def property_definition
  "@property (nonatomic) NSArray *#{@varname}; //@[#{var_sub_type}]"
end

#to_dictionary_itemObject



233
234
235
# File 'lib/ObjCGenerator/types.rb', line 233

def to_dictionary_item
  "@\"#{@varname}\" : self.#{@varname}  ?: @[]"
end