Class: TypeDate
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
#varname ⇒ Object
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 dateWithTimeIntervalSince1970:[#{origin} doubleValue]]"
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_value ⇒ Object
151
152
153
|
# File 'lib/ObjCGenerator/types.rb', line 151
def default_value
"[NSDate dateWithTimeIntervalSince1970:0.]"
end
|
#description_row ⇒ Object
163
164
165
|
# File 'lib/ObjCGenerator/types.rb', line 163
def description_row
"@\"self.#{self.varname} = %@\" , self.#{self.varname}"
end
|
#hash_row ⇒ Object
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_definition ⇒ Object
148
149
150
|
# File 'lib/ObjCGenerator/types.rb', line 148
def property_definition
"@property (nonatomic) NSDate *#{@varname};"
end
|
#to_dictionary_item ⇒ Object
157
158
159
|
# File 'lib/ObjCGenerator/types.rb', line 157
def to_dictionary_item
"@\"#{@varname}\" : @(self.#{@varname}.timeIntervalSince1970) ?: @(0.)"
end
|