Class: TypeInt

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ObjCType

#initialize

Constructor Details

This class inherits a constructor from ObjCType

Instance Attribute Details

#varnameObject

Returns the value of attribute varname.



56
57
58
# File 'lib/ObjCGenerator/types.rb', line 56

def varname
  @varname
end

Instance Method Details

#conversion_value(origin) ⇒ Object



63
64
65
# File 'lib/ObjCGenerator/types.rb', line 63

def conversion_value origin
  "[#{origin} integerValue]"
end

#copyrow(newVarName) ⇒ Object



75
76
77
# File 'lib/ObjCGenerator/types.rb', line 75

def copyrow newVarName
  "#{newVarName}.#{self.varname}  = self.#{self.varname};"
end

#default_valueObject



60
61
62
# File 'lib/ObjCGenerator/types.rb', line 60

def default_value
  "0"
end

#description_rowObject



72
73
74
# File 'lib/ObjCGenerator/types.rb', line 72

def description_row
  "@\"self.#{self.varname} = %zd\" , self.#{self.varname}"
end

#inEquality_test(other) ⇒ Object



69
70
71
# File 'lib/ObjCGenerator/types.rb', line 69

def inEquality_test other
  "self.#{self.varname}  != #{other}.#{self.varname}"
end

#property_definitionObject



57
58
59
# File 'lib/ObjCGenerator/types.rb', line 57

def property_definition
  "@property (nonatomic) NSInteger #{@varname};"
end

#to_dictionary_itemObject



66
67
68
# File 'lib/ObjCGenerator/types.rb', line 66

def to_dictionary_item
  "@\"#{@varname}\" : @(self.#{@varname})  ?: @(0)"
end