Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (40 sloc) 1.11 KB
require 'vpim/icalendar'
cal = Vpim::Icalendar.create2
cal.add_event do |e|
e.dtstart, 04, 28)
e.dtend, 04, 29)
e.summary "Monthly meet-the-CEO day"
e.description <<'---'
Unlike last one, this meeting will change your life because
we are going to discuss your likely demotion if your work isn't
done soon.
e.categories [ 'APPOINTMENT' ]
e.categories do |c| c.push 'EDUCATION' end
e.url ''
e.sequence 0
e.access_class "PRIVATE"
e.transparency 'OPAQUE'
e.set_text('LOCATION', 'my location')
now =
e.created now
e.lastmod now
e.organizer do |o| = "Example Organizer, Mr."
o.uri = ""
attendee = Vpim::Icalendar::Address.create("") = true
e.add_attendee attendee
icsfile = cal.encode
puts '--- Encode:'
puts icsfile
puts '--- Decode:'
cal = Vpim::Icalendar.decode(icsfile).first
cal.components do |e|
puts e.summary
puts e.description
puts e.dtstart.to_s
puts e.dtend.to_s