Class: RiCal::Component::Todo

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

Overview

  • ©2009 Rick DeNatale

  • All rights reserved. Refer to the file README.txt for the license

A Todo (VTODO) calendar component groups properties describing a to-do Todos may have multiple occurrences

Todos may also contain one or more ALARM subcomponents to see the property accessing methods for this class see the RiCal::Properties::Todo module to see the methods for enumerating occurrences of recurring to-dos 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 OccurrenceEnumerator

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

Methods included from Properties::Todo

#==, #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=, #completed, #completed=, #completed_property, #completed_property=, #completed_property_from_string, #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, #dtstamp, #dtstamp=, #dtstamp_property, #dtstamp_property=, #dtstamp_property_from_string, #dtstart, #dtstart=, #dtstart_property, #dtstart_property=, #dtstart_property_from_string, #due, #due=, #due_property, #due_property=, #due_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, #percent_complete, #percent_complete=, #percent_complete_property, #percent_complete_property=, #percent_complete_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, #uid, #uid=, #uid_property, #uid_property=, #uid_property_from_string, #url, #url=, #url_property, #url_property=, #url_property_from_string

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:


16
17
18
# File 'lib/ri_cal/component/todo.rb', line 16

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

Instance Method Details

#finish_timeObject

Return a date_time representing the time at which the todo is due


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

def finish_time
  if due
    due_property.to_finish_time
  elsif duration_property && dtstart_property
    (dtstart_property + duration_property).to_finish_time
  else
    nil
  end
end

#start_timeObject

Return a date_time representing the time at which the todo should start


25
26
27
# File 'lib/ri_cal/component/todo.rb', line 25

def start_time
  dtstart_property ? dtstart.to_datetime : nil
end

#subcomponent_classObject

:nodoc:


20
21
22
# File 'lib/ri_cal/component/todo.rb', line 20

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