Module: Vpim::Icalendar::Property::Common
Overview
Properties common to Vevent, Vtodo, and Vjournal.
Instance Method Summary collapse
-
#access_class ⇒ Object
This property defines the access classification for a calendar component.
-
#attachments ⇒ Object
An Array of attachments, see Attachment for more information.
-
#attendee?(uri) ⇒ Boolean
Return true if the
uri
, usually a mailto: URI, is an attendee. -
#attendees(uri = nil) ⇒ Object
Return an array of attendees, an empty array if there are none.
-
#categories ⇒ Object
This property defines the categories for a calendar component.
- #comments ⇒ Object
- #contacts ⇒ Object
- #created ⇒ Object
-
#description ⇒ Object
Description of the calendar component, or nil if there is no description.
-
#dtstamp ⇒ Object
The time stamp for this calendar component.
-
#dtstart ⇒ Object
The start time for this calendar component.
- #lastmod ⇒ Object
-
#organizer ⇒ Object
Return the event organizer, an object of Icalendar::Address (or nil if there is no ORGANIZER field).
-
#sequence ⇒ Object
Revision sequence number of the calendar component, or nil if there is no SEQUENCE; property.
-
#status ⇒ Object
Status values are not rejected during decoding.
-
#summary ⇒ Object
Summary description of the calendar component, or nil if there is no SUMMARY property.
-
#uid ⇒ Object
The unique identifier of this calendar component, a string.
- #url ⇒ Object
Instance Method Details
#access_class ⇒ Object
This property defines the access classification for a calendar component.
An access classification is only one component of the general security system within a calendar application. It provides a method of capturing the scope of the access the calendar owner intends for information within an individual calendar entry. The access classification of an individual iCalendar component is useful when measured along with the other security components of a calendar system (e.g., calendar user authentication, authorization, access rights, access role, etc.). Hence, the semantics of the individual access classifications cannot be completely defined by this memo alone. Additionally, due to the “blind” nature of most exchange processes using this memo, these access classifications cannot serve as an enforcement statement for a system receiving an iCalendar object. Rather, they provide a method for capturing the intention of the calendar owner for the access to the calendar component.
Property Name: CLASS
Property Value: one of “PUBLIC”, “PRIVATE”, “CONFIDENTIAL”, default is “PUBLIC” if no CLASS property is found.
42 43 44 |
# File 'lib/vpim/property/common.rb', line 42 def access_class proptoken 'CLASS', ["PUBLIC", "PRIVATE", "CONFIDENTIAL"], "PUBLIC" end |
#attachments ⇒ Object
An Array of attachments, see Attachment for more information.
170 171 172 173 174 |
# File 'lib/vpim/property/common.rb', line 170 def @properties.enum_by_name('ATTACH').map do |f| = Attachment.decode(f, 'uri', 'FMTTYPE') end end |
#attendee?(uri) ⇒ Boolean
Return true if the uri
, usually a mailto: URI, is an attendee.
142 143 144 |
# File 'lib/vpim/property/common.rb', line 142 def attendee?(uri) attendees.include? uri end |
#attendees(uri = nil) ⇒ Object
Return an array of attendees, an empty array if there are none. The attendees are objects of Icalendar::Address. If uri
is specified only the return the attendees with this uri
.
131 132 133 134 135 136 137 138 139 |
# File 'lib/vpim/property/common.rb', line 131 def attendees(uri = nil) attendees = @properties.enum_by_name('ATTENDEE').map { |a| Icalendar::Address.decode(a) } attendees.freeze if uri attendees.select { |a| a == uri } else attendees end end |
#categories ⇒ Object
This property defines the categories for a calendar component.
Property Name: CATEGORIES
Value Type: TEXT
Ruby Type: Array of String
This property is used to specify categories or subtypes of the calendar component. The categories are useful in searching for a calendar component of a particular type and category.
157 158 159 |
# File 'lib/vpim/property/common.rb', line 157 def categories proptextlistarray 'CATEGORIES' end |
#comments ⇒ Object
161 162 163 |
# File 'lib/vpim/property/common.rb', line 161 def comments proptextarray 'COMMENT' end |
#contacts ⇒ Object
165 166 167 |
# File 'lib/vpim/property/common.rb', line 165 def contacts proptextarray 'CONTACT' end |
#created ⇒ Object
46 47 48 |
# File 'lib/vpim/property/common.rb', line 46 def created proptime 'CREATED' end |
#description ⇒ Object
Description of the calendar component, or nil if there is no description.
52 53 54 |
# File 'lib/vpim/property/common.rb', line 52 def description proptext 'DESCRIPTION' end |
#dtstamp ⇒ Object
The time stamp for this calendar component.
63 64 65 |
# File 'lib/vpim/property/common.rb', line 63 def dtstamp proptime 'DTSTAMP' end |
#dtstart ⇒ Object
The start time for this calendar component.
68 69 70 |
# File 'lib/vpim/property/common.rb', line 68 def dtstart proptime 'DTSTART' end |
#lastmod ⇒ Object
72 73 74 |
# File 'lib/vpim/property/common.rb', line 72 def lastmod proptime 'LAST-MODIFIED' end |
#organizer ⇒ Object
Return the event organizer, an object of Icalendar::Address (or nil if there is no ORGANIZER field).
78 79 80 81 82 83 84 85 86 |
# File 'lib/vpim/property/common.rb', line 78 def organizer organizer = @properties.field('ORGANIZER') if organizer organizer = Icalendar::Address.decode(organizer) end organizer.freeze end |
#sequence ⇒ Object
Revision sequence number of the calendar component, or nil if there is no SEQUENCE; property.
58 59 60 |
# File 'lib/vpim/property/common.rb', line 58 def sequence propinteger 'SEQUENCE' end |
#status ⇒ Object
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.
96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/vpim/property/common.rb', line 96 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 |
#summary ⇒ Object
Summary description of the calendar component, or nil if there is no SUMMARY property.
115 116 117 |
# File 'lib/vpim/property/common.rb', line 115 def summary proptext 'SUMMARY' end |
#uid ⇒ Object
The unique identifier of this calendar component, a string.
120 121 122 |
# File 'lib/vpim/property/common.rb', line 120 def uid proptext 'UID' end |
#url ⇒ Object
124 125 126 |
# File 'lib/vpim/property/common.rb', line 124 def url propvalue 'URL' end |