Tom Gagne
2013-Mar-14 20:43 UTC
[iCalendar-devel] Ruby newbie, how to access an attendee''s email
If an attendee''s inspect reads: #<URI::MailTo:0xb764a69c URL:mailto:tgagne at xede.com> How do I (correctly) access the email address by itself? My objective is to create a webservice I can interact with from Salesforce (via REST) that will convert ics/ical attachments into Salesforce events, and convert them back. The first thing I want to do is figure out how to access the elements of an invitation to create my event. My code is at the bottom. What I''m trying to figure out is how can I properly access an attendee''s email? require ''rubygems'' require ''icalendar'' require ''date'' invite = File.open("invite.ics") cals = Icalendar.parse(invite) for each in cals do puts each.inspect puts for eachEvent in each.events do puts eachEvent.summary puts eachEvent.description puts eachEvent.dtstart puts eachEvent.dtend puts puts eachEvent.organizer.inspect for eachAttendee in eachEvent.attendees do puts eachAttendee.inspect end end puts end