Class: RiCal::Component::Event

Inherits:
RiCal::Component show all
Includes:
OccurrenceEnumerator, Properties::Event
Defined in:
lib/ri_cal/component/event.rb

Overview

  • ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license

An Event (VEVENT) calendar component groups properties describing a scheduled event. Events may have multiple occurrences

Events may also contain one or more ALARM subcomponents

to see the property accessing methods for this class see the RiCal::Properties::Event module to see the methods for enumerating occurrences of recurring events see the RiCal::OccurrenceEnumerator module

Instance Attribute Summary

Attributes inherited from RiCal::Component

#imported

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Properties::Event

#==, #add_attach, #add_attachments, #add_attendee, #add_attendees, #add_categories, #add_comment, #add_comments, #add_contact, #add_contacts, #add_date_times_to, #add_exdate, #add_exdates, #add_exrule, #add_exrules, #add_multiple_categories, #add_multiple_related_to, #add_multiple_resources, #add_rdate, #add_rdates, #add_related_to, #add_request_status, #add_request_statuses, #add_resources, #add_rrule, #add_rrules, #attach, #attach=, #attach_property, #attach_property=, #attach_property_from_string, #attachments=, #attendee, #attendee=, #attendee_property, #attendee_property=, #attendee_property_from_string, #attendees=, #categories, #categories=, #categories_property, #categories_property=, #categories_property_from_string, #class_property, #class_property=, #class_property_from_string, #comment, #comment=, #comment_property, #comment_property=, #comment_property_from_string, #comments=, #contact, #contact=, #contact_property, #contact_property=, #contact_property_from_string, #contacts=, #created, #created=, #created_property, #created_property=, #created_property_from_string, #description, #description=, #description_property, #description_property=, #description_property_from_string, #dtend, #dtend=, #dtend_property, #dtend_property=, #dtend_property_from_string, #dtstamp, #dtstamp=, #dtstamp_property, #dtstamp_property=, #dtstamp_property_from_string, #dtstart, #dtstart=, #dtstart_property, #dtstart_property=, #dtstart_property_from_string, #duration, #duration=, #duration_property, #duration_property=, #duration_property_from_string, #exdate, #exdate=, #exdate_property, #exdate_property=, #exdate_property_from_string, #exdates=, #export_properties_to, #exrule, #exrule=, #exrule_property, #exrule_property=, #exrule_property_from_string, #exrules=, #geo, #geo=, #geo_property, #geo_property=, #geo_property_from_string, included, #initialize_copy, #last_modified, #last_modified=, #last_modified_property, #last_modified_property=, #last_modified_property_from_string, #location, #location=, #location_property, #location_property=, #location_property_from_string, #multiple_categories=, #multiple_related_to=, #multiple_resources=, #mutual_exclusion_violation, #organizer, #organizer=, #organizer_property, #organizer_property=, #organizer_property_from_string, #priority, #priority=, #priority_property, #priority_property=, #priority_property_from_string, #rdate, #rdate=, #rdate_property, #rdate_property=, #rdate_property_from_string, #rdates=, #recurrence_id, #recurrence_id=, #recurrence_id_property, #recurrence_id_property=, #recurrence_id_property_from_string, #related_to, #related_to=, #related_to_property, #related_to_property=, #related_to_property_from_string, #remove_attach, #remove_attachments, #remove_attendee, #remove_attendees, #remove_categories, #remove_comment, #remove_comments, #remove_contact, #remove_contacts, #remove_exdate, #remove_exdates, #remove_exrule, #remove_exrules, #remove_multiple_categories, #remove_multiple_related_to, #remove_multiple_resources, #remove_rdate, #remove_rdates, #remove_related_to, #remove_request_status, #remove_request_statuses, #remove_resources, #remove_rrule, #remove_rrules, #request_status, #request_status=, #request_status_property, #request_status_property=, #request_status_property_from_string, #request_statuses=, #resources, #resources=, #resources_property, #resources_property=, #resources_property_from_string, #rrule, #rrule=, #rrule_property, #rrule_property=, #rrule_property_from_string, #rrules=, #security_class, #security_class=, #sequence, #sequence=, #sequence_property, #sequence_property=, #sequence_property_from_string, #status, #status=, #status_property, #status_property=, #status_property_from_string, #summary, #summary=, #summary_property, #summary_property=, #summary_property_from_string, #transp, #transp=, #transp_property, #transp_property=, #transp_property_from_string, #uid, #uid=, #uid_property, #uid_property=, #uid_property_from_string, #url, #url=, #url_property, #url_property=, #url_property_from_string

Methods included from OccurrenceEnumerator

#after_range?, #before_range?, #bounded?, #default_duration, #default_start_time, #each, #enumeration_instance, #occurrences, #recurrence, #recurs?, #set_occurrence_properties!, #zulu_occurrence_range

Methods inherited from RiCal::Component

#add_property_date_times_to, #add_subcomponent, #add_x_property, #alarms, #daylight, #default_tzid, #entity_name, #export, #export_prop_to, #export_subcomponent_to, #export_to, #export_x_properties_to, #find_timezone, from_parser, #imported?, #initialize, #initialize_copy, #last_before_local, #last_before_utc, #last_period, #method_missing, parse, parse_string, #parse_subcomponent, #process_line, #prop_string, #standard, #subcomponents, #time_zone_for, #to_s, #tz_info_source?, #valid?, #x_properties

Constructor Details

This class inherits a constructor from RiCal::Component

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RiCal::Component

Class Method Details

.entity_nameObject

:nodoc:



21
22
23
# File 'lib/ri_cal/component/event.rb', line 21

def self.entity_name #:nodoc:
  "VEVENT"
end

Instance Method Details

#finish_propertyObject

Return a date_time_property representing the time at which the event ends



31
32
33
34
35
36
37
38
39
# File 'lib/ri_cal/component/event.rb', line 31

def finish_property
  if dtend_property
    dtend_property
  elsif duration_property
    (dtstart_property + duration_property)
  else
    dtstart_property
  end
end

#finish_timeObject

Return a date_time representing the time at which the event starts



42
43
44
45
# File 'lib/ri_cal/component/event.rb', line 42

def finish_time
  prop = finish_property
  prop ? prop.to_finish_time : nil
end

#start_timeObject

Return a date_time representing the time at which the event starts



26
27
28
# File 'lib/ri_cal/component/event.rb', line 26

def start_time
  dtstart_property ? dtstart.to_datetime : nil
end

#subcomponent_classObject

:nodoc:



17
18
19
# File 'lib/ri_cal/component/event.rb', line 17

def subcomponent_class #:nodoc:
  {:alarm => Alarm }
end

#zulu_occurrence_range_finish_timeObject



51
52
53
54
# File 'lib/ri_cal/component/event.rb', line 51

def zulu_occurrence_range_finish_time
  prop = finish_property
  prop ? prop.to_zulu_occurrence_range_finish_time : nil
end

#zulu_occurrence_range_start_timeObject



47
48
49
# File 'lib/ri_cal/component/event.rb', line 47

def zulu_occurrence_range_start_time
 dtstart_property ? dtstart_property.to_zulu_occurrence_range_start_time : nil
end