Class: TypeDate

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.



147
148
149
# File 'lib/ObjCGenerator/types.rb', line 147

def varname
  @varname
end

Instance Method Details

#conversion_value(origin) ⇒ Object



154
155
156
# File 'lib/ObjCGenerator/types.rb', line 154

def conversion_value origin
  "[NSDate ic_dateFromIso8601String:#{origin}]"
end

#copyrow(newVarName) ⇒ Object



166
167
168
# File 'lib/ObjCGenerator/types.rb', line 166

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

#default_valueObject



151
152
153
# File 'lib/ObjCGenerator/types.rb', line 151

def default_value
  "[NSDate dateWithTimeIntervalSince1970:0.]"
end

#description_rowObject



163
164
165
# File 'lib/ObjCGenerator/types.rb', line 163

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

#hash_rowObject



169
170
171
# File 'lib/ObjCGenerator/types.rb', line 169

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

#inEquality_test(other) ⇒ Object



160
161
162
# File 'lib/ObjCGenerator/types.rb', line 160

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

#property_definitionObject



148
149
150
# File 'lib/ObjCGenerator/types.rb', line 148

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

#to_dictionary_itemObject



157
158
159
# File 'lib/ObjCGenerator/types.rb', line 157

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