Method: Vpim::Icalendar::Vevent#accept

Defined in:
lib/vpim/vevent.rb

#accept(invitee) ⇒ Object

Accept an event invitation. The invitee is the Address that wishes to accept the event invitation as confirmed.

The event created is identical to this one, but

  • without the attendees

  • with the invitee added with a PARTSTAT of ACCEPTED



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/vpim/vevent.rb', line 92

def accept(invitee)
  # FIXME - move to Vpim::Itip.
  invitee = invitee.copy
  invitee.partstat = 'ACCEPTED'

  fields = []

  @properties.each_with_index do
    |f,i|

    # put invitee in as field[1]
    fields << invitee.encode('ATTENDEE') if i == 1
    
    fields << f unless f.name? 'ATTENDEE'
  end

  Vevent.new(fields)
end