Sha256: be655807520806f44020619fa5a37c9917c2586d94c367b7a4160b46db96fb44

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

module RiCal
  module CoreExtensions #:nodoc:
    module Time #:nodoc:
      #- ©2009 Rick DeNatale
      #- All rights reserved. Refer to the file README.txt for the license
      #
      module Conversions
        # Return an RiCal::PropertyValue::DateTime representing the receiver
        def to_ri_cal_date_time_value(timezone_finder = nil) #:nodoc:
          RiCal::PropertyValue::DateTime.new(
               timezone_finder, 
               :value => strftime("%Y%m%dT%H%M%S"), 
               :params => {"TZID" => self.tzid || :default})
        end

        alias_method :to_ri_cal_date_or_date_time_value, :to_ri_cal_date_time_value #:nodoc:
        alias_method :to_ri_cal_occurrence_list_value, :to_ri_cal_date_time_value #:nodoc:

        # Return the natural ri_cal_property for this object
        def to_ri_cal_property_value(timezone_finder = nil) #:nodoc:
          to_ri_cal_date_time_value(timezone_finder)
        end
        
        # Return a copy of this object which will be interpreted as a floating time.
        def with_floating_timezone
          dup.set_tzid(:floating)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubyredrick-ri_cal-0.0.3 lib/ri_cal/core_extensions/time/conversions.rb
rubyredrick-ri_cal-0.0.4 lib/ri_cal/core_extensions/time/conversions.rb
rubyredrick-ri_cal-0.0.5 lib/ri_cal/core_extensions/time/conversions.rb
rubyredrick-ri_cal-0.0.6 lib/ri_cal/core_extensions/time/conversions.rb
rubyredrick-ri_cal-0.0.7 lib/ri_cal/core_extensions/time/conversions.rb
rubyredrick-ri_cal-0.0.8 lib/ri_cal/core_extensions/time/conversions.rb