Vpim::Icalendar::Set::Common

Properties common to Vevent, Vtodo, and Vjournal.

Public Instance Methods

access_class(token) click to toggle source

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

# File lib/vpim/property/common.rb, line 184
def access_class(token)
  set_token 'CLASS', ["PUBLIC", "PRIVATE", "CONFIDENTIAL"], "PUBLIC", token
end
add_attendee(adr) click to toggle source

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

# File lib/vpim/property/common.rb, line 273
def add_attendee(adr)
  add_address('ATTENDEE', adr)
end
categories(cats = nil) click to toggle source

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.

# 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) click to toggle source

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

# File lib/vpim/property/common.rb, line 292
def comment(value)
  set_text 'COMMENT', value
end
created(time) click to toggle source

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

# File lib/vpim/property/common.rb, line 189
def created(time)
  set_datetime 'CREATED', time
end
description(text) click to toggle source

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

# File lib/vpim/property/common.rb, line 194
def description(text)
  set_text 'DESCRIPTION', text
end
dtstamp(time) click to toggle source

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

# File lib/vpim/property/common.rb, line 205
def dtstamp(time)
  set_datetime 'DTSTAMP', time
  self
end
dtstart(start) click to toggle source

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

# File lib/vpim/property/common.rb, line 211
def dtstart(start)
  set_date_or_datetime 'DTSTART', 'DATE-TIME', start
  self
end
lastmod(time) click to toggle source

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

# File lib/vpim/property/common.rb, line 217
def lastmod(time)
  set_datetime 'LAST-MODIFIED', time
  self
end
organizer(adr=nil) click to toggle source

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.

# 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) click to toggle source

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

# File lib/vpim/property/common.rb, line 200
def sequence(int)
  set_integer 'SEQUENCE', int
end
summary(text) click to toggle source
# Status values are not rejected during decoding. However, if the
# status is requested, and it's value is not one of the defined
# allowable values, an exception is raised.
def status
  case self
  when Vpim::Icalendar::Vevent
    proptoken 'STATUS', ['TENTATIVE', 'CONFIRMED', 'CANCELLED']

  when Vpim::Icalendar::Vtodo
    proptoken 'STATUS', ['NEEDS-ACTION', 'COMPLETED', 'IN-PROCESS', 'CANCELLED']

  when Vpim::Icalendar::Vevent
    proptoken 'STATUS', ['DRAFT', 'FINAL', 'CANCELLED']
  end
end

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

# File lib/vpim/property/common.rb, line 259
def summary(text)
  set_text 'SUMMARY', text
end
uid(uid) click to toggle source

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

# File lib/vpim/property/common.rb, line 264
def uid(uid)
  set_text 'UID', uid
end
url(url) click to toggle source
# File lib/vpim/property/common.rb, line 268
def url(url)
  set_text 'URL', url
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.