File: timezone.rb

package info (click to toggle)
mhc 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,320 kB
  • ctags: 3,529
  • sloc: ruby: 12,404; lisp: 7,448; makefile: 70; sh: 69
file content (150 lines) | stat: -rw-r--r-- 4,939 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
module RiCal
  module Properties #:nodoc:
    #- ©2009 Rick DeNatale
    #- All rights reserved. Refer to the file README.txt for the license
    #
    # Properties::Timezone provides property accessing methods for the Timezone class
    # This source file is generated by the  rical:gen_propmodules rake tasks, DO NOT EDIT
    module Timezone

      # return the the TZID property
      # which will be an instances of RiCal::PropertyValueText
      # 
      # [purpose (from RFC 2445)]
      # This property specifies the text value that uniquely indentifies the "VTIMEZONE" calendar component.
      # 
      # see RFC 2445 4.8.3.1 pp 97-98
      def tzid_property
        @tzid_property
      end

      # set the TZID property
      # property value should be an instance of RiCal::PropertyValueText
      def tzid_property=(property_value)
        @tzid_property = property_value
      end

      # set the value of the TZID property
      def tzid=(ruby_value)
        self.tzid_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
      end

      # return the value of the TZID property
      # which will be an instance of String
      def tzid
        tzid_property ? tzid_property.ruby_value : nil
      end

      def tzid_property_from_string(line) # :nodoc:
        @tzid_property = RiCal::PropertyValue::Text.new(self, line)
      end


      # return the the LAST-MODIFIED property
      # which will be an instances of RiCal::PropertyValueZuluDateTime
      # 
      # [purpose (from RFC 2445)]
      # This property specifies the date and time that the information associated with the calendar component was last revised in teh calendar store.
      # 
      # see RFC 2445 4.8.7.3 p 131
      def last_modified_property
        @last_modified_property
      end

      # set the LAST-MODIFIED property
      # property value should be an instance of RiCal::PropertyValueZuluDateTime
      def last_modified_property=(property_value)
        @last_modified_property = property_value
      end

      # set the value of the LAST-MODIFIED property
      def last_modified=(ruby_value)
        self.last_modified_property= RiCal::PropertyValue::ZuluDateTime.convert(self, ruby_value)
      end

      # return the value of the LAST-MODIFIED property
      # which will be an instance of ZuluDateTime
      def last_modified
        last_modified_property ? last_modified_property.ruby_value : nil
      end

      def last_modified_property_from_string(line) # :nodoc:
        @last_modified_property = RiCal::PropertyValue::ZuluDateTime.new(self, line)
      end


      # return the the TZURL property
      # which will be an instances of RiCal::PropertyValueUri
      # 
      # [purpose (from RFC 2445)]
      # The TZURL provies a means for a VTIMEZONE component to point to a network location that can be used to retrieve an up-to_date version of itself.
      # 
      # see RFC 2445 4.8.3.4 p 101
      def tzurl_property
        @tzurl_property
      end

      # set the TZURL property
      # property value should be an instance of RiCal::PropertyValueUri
      def tzurl_property=(property_value)
        @tzurl_property = property_value
      end

      # set the value of the TZURL property
      def tzurl=(ruby_value)
        self.tzurl_property= RiCal::PropertyValue::Uri.convert(self, ruby_value)
      end

      # return the value of the TZURL property
      # which will be an instance of Uri
      def tzurl
        tzurl_property ? tzurl_property.ruby_value : nil
      end

      def tzurl_property_from_string(line) # :nodoc:
        @tzurl_property = RiCal::PropertyValue::Uri.new(self, line)
      end


      def export_properties_to(export_stream) #:nodoc:
        export_prop_to(export_stream, "TZURL", @tzurl_property)
        export_prop_to(export_stream, "LAST-MODIFIED", @last_modified_property)
        export_prop_to(export_stream, "TZID", @tzid_property)
      end

      def ==(o) #:nodoc:
        if o.class == self.class
        (tzurl_property == o.tzurl_property) &&
        (last_modified_property == o.last_modified_property) &&
        (tzid_property == o.tzid_property)
        else
           super
        end
      end

      def initialize_copy(o) #:nodoc:
        super
        tzurl_property = tzurl_property && tzurl_property.dup
        last_modified_property = last_modified_property && last_modified_property.dup
        tzid_property = tzid_property && tzid_property.dup
      end

      def add_date_times_to(required_timezones) #:nodoc:
      end

      module ClassMethods #:nodoc:
        def property_parser #:nodoc:
          {"TZURL"=>:tzurl_property_from_string, "TZID"=>:tzid_property_from_string, "LAST-MODIFIED"=>:last_modified_property_from_string}
        end
      end

      def self.included(mod) #:nodoc:
        mod.extend ClassMethods
      end

      def mutual_exclusion_violation #:nodoc:
        false
      end
    end
  end
end