Sha256: 7f2a11fdb2e2c9c60c01049a7ec3cc3d8b28f8922d3429a1ce99284a76cdff81

Contents?: true

Size: 1.38 KB

Versions: 11

Compression:

Stored size: 1.38 KB

Contents

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

module RiCal
  class Component
    class Timezone
      #- ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license
      #
      # A TimezonePeriod is a component of a timezone representing a period during which a particular offset from UTC is
      # in effect.
      #
      # to see the property accessing methods for this class see the RiCal::Properties::TimezonePeriod module
      class TimezonePeriod < Component
        include Properties::TimezonePeriod

        include OccurrenceEnumerator

        def zone_identifier #:nodoc:
          tzname.first
        end

        def dtend #:nodoc:
          nil
        end

        def exdate_property #:nodoc:
          nil
        end
        
        def utc_total_offset #:nodoc:
          tzoffsetto_property.to_seconds
        end

        def exrule_property #:nodoc:
          nil
        end

        def last_before_utc(utc_time) #:nodoc:
          last_before_local(utc_time + tzoffsetfrom_property)
        end

        def last_before_local(local_time) #:nodoc:
          cand_occurrence = nil
          each do |occurrence|
            return cand_occurrence if occurrence.dtstart_property > local_time
            cand_occurrence = occurrence
          end
          return cand_occurrence
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rubyredrick-ri_cal-0.0.10 lib/ri_cal/component/timezone/timezone_period.rb
rubyredrick-ri_cal-0.0.11 lib/ri_cal/component/timezone/timezone_period.rb
rubyredrick-ri_cal-0.0.7 lib/ri_cal/component/timezone/timezone_period.rb
rubyredrick-ri_cal-0.0.8 lib/ri_cal/component/timezone/timezone_period.rb
rubyredrick-ri_cal-0.0.9 lib/ri_cal/component/timezone/timezone_period.rb
rubyredrick-ri_cal-0.5.0 lib/ri_cal/component/timezone/timezone_period.rb
rubyredrick-ri_cal-0.5.1 lib/ri_cal/component/timezone/timezone_period.rb
rubyredrick-ri_cal-0.5.2 lib/ri_cal/component/timezone/timezone_period.rb
ri_cal-0.5.2 lib/ri_cal/component/timezone/timezone_period.rb
ri_cal-0.5.1 lib/ri_cal/component/timezone/timezone_period.rb
ri_cal-0.5.0 lib/ri_cal/component/timezone/timezone_period.rb