Sha256: fa365f06974004c9adea00da9d19b21955b416232c63de811728acaa5badc0dd

Contents?: true

Size: 1.74 KB

Versions: 14

Compression:

Stored size: 1.74 KB

Contents

module RiCal
  class Component
    #- ©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
    class Event < Component
      include OccurrenceEnumerator

      include RiCal::Properties::Event

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

      def self.entity_name #:nodoc:
        "VEVENT"
      end
      
      # Return a date_time representing the time at which the event starts
      def start_time
        dtstart_property ? dtstart.to_datetime : nil
      end
      
      # Return a date_time_property representing the time at which the event ends
      def finish_property
        if dtend_property
          dtend_property
        elsif duration_property
          (dtstart_property + duration_property)
        else
          dtstart_property
        end
      end

      # Return a date_time representing the time at which the event starts
      def finish_time
        prop = finish_property
        prop ? prop.to_finish_time : nil
      end
      
      def zulu_occurrence_range_start_time
        dtstart_property ? dtstart_property.to_zulu_occurrence_range_start_time : nil
       end
      
      def zulu_occurrence_range_finish_time
        prop = finish_property
        prop ? prop.to_zulu_occurrence_range_finish_time : nil
      end
      
    end
  end
end

Version data entries

14 entries across 14 versions & 7 rubygems

Version Path
demingfactor-ri_cal-0.10.0 lib/ri_cal/component/event.rb
demingfactor-ri_cal-0.9.0 lib/ri_cal/component/event.rb
rubyredrick-ri_cal-0.8.4 lib/ri_cal/component/event.rb
awallis-ri_cal-0.8.8 lib/ri_cal/component/event.rb
justinsoong-ri_cal-0.8.9 lib/ri_cal/component/event.rb
justinsoong-ri_cal-0.8.8 lib/ri_cal/component/event.rb
micahwedemeyer-ri_cal-0.8.10 lib/ri_cal/component/event.rb
micahwedemeyer-ri_cal-0.8.9 lib/ri_cal/component/event.rb
ri_cal-0.8.8 lib/ri_cal/component/event.rb
ri_cal-0.8.7 lib/ri_cal/component/event.rb
ri_cal-0.8.6 lib/ri_cal/component/event.rb
miguelbaldi-ri_cal-0.1 lib/ri_cal/component/event.rb
ri_cal-0.8.5 lib/ri_cal/component/event.rb
ri_cal-0.8.4 lib/ri_cal/component/event.rb