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.



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

def varname
  @varname
end

Instance Method Details

#conversion_value(origin) ⇒ Object



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

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

#copyrow(newVarName) ⇒ Object



82
83
84
# File 'lib/ObjCGenerator/types.rb', line 82

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

#default_valueObject



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

def default_value
  "0"
end

#description_rowObject



79
80
81
# File 'lib/ObjCGenerator/types.rb', line 79

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

#hash_rowObject



85
86
87
# File 'lib/ObjCGenerator/types.rb', line 85

def hash_row
  "self.#{self.varname};"
end

#inEquality_test(other) ⇒ Object



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

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

#property_definitionObject



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

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

#to_dictionary_itemObject



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

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