# File lib/vpim/vevent.rb, line 65 def Vevent.create(start = Time.now, fields=[]) # TODO # - maybe events are usually created in a particular way? With a # start/duration or a start/end? Maybe I can make it easier. Ideally, I # would like to make it hard to encode an invalid Event. # - I don't think its useful to have a default dtstart for events # - also, I don't think dstart is mandatory dtstart = DirectoryInfo::Field.create('DTSTART', start) di = DirectoryInfo.create([ dtstart ], 'VEVENT') Vpim::DirectoryInfo::Field.create_array(fields).each { |f| di.push_unique f } new(di.to_a) end