Class: Vcard::V3_0::PropertyValue::Date
Instance Attribute Summary
#errors, #norm, #type, #value
Instance Method Summary
collapse
#name, #to_norm
Constructor Details
#initialize(val) ⇒ Date
Returns a new instance of Date.
166
167
168
169
|
# File 'lib/vobject/vcard/v3_0/propertyvalue.rb', line 166
def initialize(val)
self.value = val
self.type = "date"
end
|
Instance Method Details
#<=>(another) ⇒ Object
162
163
164
|
# File 'lib/vobject/vcard/v3_0/propertyvalue.rb', line 162
def <=>(another)
value <=> another.value
end
|
#to_hash ⇒ Object
175
176
177
|
# File 'lib/vobject/vcard/v3_0/propertyvalue.rb', line 175
def to_hash
value
end
|
#to_s ⇒ Object
171
172
173
|
# File 'lib/vobject/vcard/v3_0/propertyvalue.rb', line 171
def to_s
sprintf("%04d-%02d-%02d", value[:year].to_i, value[:month].to_i, value[:day].to_i)
end
|