Class: TypeString

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.



119
120
121
# File 'lib/ObjCGenerator/types.rb', line 119

def varname
  @varname
end

Instance Method Details

#conversion_value(origin) ⇒ Object



126
127
128
# File 'lib/ObjCGenerator/types.rb', line 126

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

#copyrow(newVarName) ⇒ Object



138
139
140
# File 'lib/ObjCGenerator/types.rb', line 138

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

#default_valueObject



123
124
125
# File 'lib/ObjCGenerator/types.rb', line 123

def default_value
  "@\"\""
end

#description_rowObject



135
136
137
# File 'lib/ObjCGenerator/types.rb', line 135

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

#hash_rowObject



141
142
143
# File 'lib/ObjCGenerator/types.rb', line 141

def hash_row
  "[self.#{self.varname} hash];"
end

#inEquality_test(other) ⇒ Object



132
133
134
# File 'lib/ObjCGenerator/types.rb', line 132

def inEquality_test other
  "![self.#{self.varname}  isEqual:#{other}.#{self.varname}]"
end

#property_definitionObject



120
121
122
# File 'lib/ObjCGenerator/types.rb', line 120

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

#to_dictionary_itemObject



129
130
131
# File 'lib/ObjCGenerator/types.rb', line 129

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