Sha256: da8b9dda38d5bceb676fe5ab6fbda0a78b14b32590bcaa44cd493bfdb70d0399

Contents?: true

Size: 1.29 KB

Versions: 6

Compression:

Stored size: 1.29 KB

Contents

require File.join(File.dirname(__FILE__), %w[.. properties todo.rb])

module RiCal
  class Component
    #- ©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
    class Todo < Component
      include Properties::Todo

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

      def subcomponent_class #:nodoc:
        {:alarm => Alarm }
      end
      
      # Return a date_time representing the time at which the todo should start
      def start_time
        dtstart_property ? dtstart.to_datetime : nil
      end
      
      # Return a date_time representing the time at which the todo is due
      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
      
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
rubyredrick-ri_cal-0.5.0 lib/ri_cal/component/todo.rb
rubyredrick-ri_cal-0.5.1 lib/ri_cal/component/todo.rb
rubyredrick-ri_cal-0.5.2 lib/ri_cal/component/todo.rb
ri_cal-0.5.0 lib/ri_cal/component/todo.rb
ri_cal-0.5.2 lib/ri_cal/component/todo.rb
ri_cal-0.5.1 lib/ri_cal/component/todo.rb