class TypeCustomObject

Attributes

var_type[RW]
varname[RW]

Public Class Methods

new( name , type) click to toggle source
Calls superclass method ObjCType::new
# File lib/ObjCGenerator/types.rb, line 179
def initialize( name , type)
  super(name)
  @var_type = type
end

Public Instance Methods

conversion_value(origin) click to toggle source
# File lib/ObjCGenerator/types.rb, line 189
def conversion_value origin
  # "[#{origin} description]"
  "[[#{var_type} alloc] initWithDict:#{origin}]"
end
copyrow(newVarName) click to toggle source
# File lib/ObjCGenerator/types.rb, line 202
def copyrow newVarName
  "#{newVarName}.#{self.varname}  = [self.#{self.varname} copyWithZone:nil];"
end
default_value() click to toggle source
# File lib/ObjCGenerator/types.rb, line 186
def default_value
  "[#{@var_type} new]"
end
description_row() click to toggle source
# File lib/ObjCGenerator/types.rb, line 199
def description_row
  "@\"self.#{self.varname} = %@\" , self.#{self.varname}"
end
hash_row() click to toggle source
# File lib/ObjCGenerator/types.rb, line 205
def hash_row
  "[self.#{self.varname} hash];"
end
inEquality_test(other) click to toggle source
# File lib/ObjCGenerator/types.rb, line 196
def inEquality_test other
  "![self.#{self.varname}  isEqual:#{other}.#{self.varname}]"
end
property_definition() click to toggle source
# File lib/ObjCGenerator/types.rb, line 183
def property_definition
  "@property (nonatomic) #{@var_type} *#{@varname};"
end
to_dictionary_item() click to toggle source
# File lib/ObjCGenerator/types.rb, line 193
def to_dictionary_item
  "@\"#{@varname}\" : [self.#{@varname} toDict]  ?: @{}"
end