class Vobject::Vcalendar::PropertyValue::DateTimeUTC

Public Class Methods

new(val) click to toggle source
# File lib/vobject/vcalendar/propertyvalue.rb, line 306
def initialize(val)
  self.value = val.clone
  value[:time] =  ::Time.utc(val[:year], val[:month], val[:day], val[:hour], val[:min], val[:sec])
  value[:origtime] = value[:time]
end

Public Instance Methods

<=>(another) click to toggle source
# File lib/vobject/vcalendar/propertyvalue.rb, line 302
def <=>(another)
  value[:time] <=> another.value[:time]
end
to_hash() click to toggle source
# File lib/vobject/vcalendar/propertyvalue.rb, line 319
def to_hash
  ret = {
    year: value[:year],
    month: value[:month],
    day: value[:day],
    hour: value[:hour],
    min: value[:min],
    sec: value[:sec],
  }
  ret
end
to_s() click to toggle source
# File lib/vobject/vcalendar/propertyvalue.rb, line 312
def to_s
  localtime = value[:origtime]
  ret = sprintf("%04d%02d%02dT%02d%02d%02dZ", localtime.year, localtime.month, localtime.day,
                localtime.hour, localtime.min, localtime.sec)
  ret
end