Module: Vpim::Icalendar::Set::Common

Included in:
Vevent::Maker
Defined in:
lib/vpim/property/common.rb

Overview

Properties common to Vevent, Vtodo, and Vjournal.

Instance Method Summary collapse

Instance Method Details

#access_class(token) ⇒ Object

Set the access class of the component, see Icalendar::Property::Common#access_class.



184
185
186
# File 'lib/vpim/property/common.rb', line 184

def access_class(token)
  set_token 'CLASS', ["PUBLIC", "PRIVATE", "CONFIDENTIAL"], "PUBLIC", token
end

#add_attendee(adr) ⇒ Object

Add an attendee Address, see Icalendar::Property::Common#attendees.



273
274
275
# File 'lib/vpim/property/common.rb', line 273

def add_attendee(adr)
  add_address('ATTENDEE', adr)
end

#categories(cats = nil) ⇒ Object

Set the categories, see Icalendar::Property::Common#attendees.

If cats is provided, the categories are set to cats, either a String or an Array of String. Otherwise, and array of the existing category strings is yielded, and it can be modified.



282
283
284
285
286
287
288
289
# File 'lib/vpim/property/common.rb', line 282

def categories(cats = nil) #:yield: categories
  unless cats
    cats = @comp.categories
    yield cats
  end
  # TODO - strip the strings
  set_text_list('CATEGORIES', cats)
end

#comment(value) ⇒ Object

Set the comment, see Icalendar::Property::Common#comments.



292
293
294
# File 'lib/vpim/property/common.rb', line 292

def comment(value)
  set_text 'COMMENT', value
end

#created(time) ⇒ Object

Set the creation time, see Icalendar::Property::Common#created



189
190
191
# File 'lib/vpim/property/common.rb', line 189

def created(time)
  set_datetime 'CREATED', time
end

#description(text) ⇒ Object

Set the description, see Icalendar::Property::Common#description.



194
195
196
# File 'lib/vpim/property/common.rb', line 194

def description(text)
  set_text 'DESCRIPTION', text
end

#dtstamp(time) ⇒ Object

Set the timestamp, see Icalendar::Property::Common#timestamp.



205
206
207
208
# File 'lib/vpim/property/common.rb', line 205

def dtstamp(time)
  set_datetime 'DTSTAMP', time
  self
end

#dtstart(start) ⇒ Object

The start time or date, see Icalendar::Property::Common#dtstart.



211
212
213
214
# File 'lib/vpim/property/common.rb', line 211

def dtstart(start)
  set_date_or_datetime 'DTSTART', 'DATE-TIME', start
  self
end

#lastmod(time) ⇒ Object

Set the last modification time, see Icalendar::Property::Common#lastmod.



217
218
219
220
# File 'lib/vpim/property/common.rb', line 217

def lastmod(time)
  set_datetime 'LAST-MODIFIED', time
  self
end

#organizer(adr = nil) ⇒ Object

Set the event organizer, an Icalendar::Address, see Icalendar::Property::Common#organizer.

Without an adr it yields an Icalendar::Address that is a copy of the current organizer (if any), allowing it to be modified.



226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/vpim/property/common.rb', line 226

def organizer(adr=nil) #:yield: organizer
  unless adr
    adr = @comp.organizer
    if adr
      adr = adr.copy
    else
      adr = Icalendar::Address.create
    end
    yield adr
  end
  set_address('ORGANIZER', adr)
  self
end

#sequence(int) ⇒ Object

Set the sequence number, see Icalendar::Property::Common#sequence. is no SEQUENCE; property.



200
201
202
# File 'lib/vpim/property/common.rb', line 200

def sequence(int)
  set_integer 'SEQUENCE', int
end

#summary(text) ⇒ Object

Set summary description of component, see Icalendar::Property::Common#summary.



259
260
261
# File 'lib/vpim/property/common.rb', line 259

def summary(text)
  set_text 'SUMMARY', text
end

#uid(uid) ⇒ Object

Set the unique identifier of this calendar component, see Icalendar::Property::Common#uid.



264
265
266
# File 'lib/vpim/property/common.rb', line 264

def uid(uid)
  set_text 'UID', uid
end

#url(url) ⇒ Object



268
269
270
# File 'lib/vpim/property/common.rb', line 268

def url(url)
  set_text 'URL', url
end