Class: Vobject::Vcalendar::PropertyValue::Date

Inherits:
PropertyValue show all
Includes:
Comparable
Defined in:
lib/vobject/vcalendar/propertyvalue.rb

Instance Attribute Summary

Attributes inherited from PropertyValue

#errors, #norm, #type, #value

Instance Method Summary collapse

Methods inherited from PropertyValue

#name, #to_norm

Constructor Details

#initialize(val) ⇒ Date

Returns a new instance of Date.



245
246
247
248
# File 'lib/vobject/vcalendar/propertyvalue.rb', line 245

def initialize(val)
  self.value = val
  self.type = "date"
end

Instance Method Details

#<=>(another) ⇒ Object



241
242
243
# File 'lib/vobject/vcalendar/propertyvalue.rb', line 241

def <=>(another)
  value <=> another.value
end

#to_hashObject



254
255
256
# File 'lib/vobject/vcalendar/propertyvalue.rb', line 254

def to_hash
  value
end

#to_sObject



250
251
252
# File 'lib/vobject/vcalendar/propertyvalue.rb', line 250

def to_s
  sprintf("%04d%02d%02d", value.year, value.month, value.day)
end