File: calendar.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 (164 lines) | stat: -rw-r--r-- 5,609 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
module RiCal
  module Properties #:nodoc:
    #- ©2009 Rick DeNatale
    #- All rights reserved. Refer to the file README.txt for the license
    #
    # Properties::Calendar provides property accessing methods for the Calendar class
    # This source file is generated by the  rical:gen_propmodules rake tasks, DO NOT EDIT
    module Calendar

      # return the the CALSCALE property
      # which will be an instances of RiCal::PropertyValueText
      # 
      # [purpose (from RFC 2445)]
      # This property defines the calendar scale used for the calendar information specified in the calendar object.
      # 
      # see RFC 2445 4.7.1 p 73
      def calscale_property
        @calscale_property ||= RiCal::PropertyValue::Text.convert(self, "GREGORIAN")
      end

      # return the value of the CALSCALE property
      # which will be an instance of String
      def calscale
        calscale_property ? calscale_property.ruby_value : nil
      end

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


      # return the the METHOD property
      # which will be an instances of RiCal::PropertyValueText
      # 
      # [purpose (from RFC 2445)]
      # This property defines the iCalendar object method associated with the calendar object
      # 
      # see RFC 2445 4.7.2 p 74-75
      def method_property
        @method_property
      end

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

      # set the value of the METHOD property
      def icalendar_method=(ruby_value)
        self.method_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
      end

      # return the value of the METHOD property
      # which will be an instance of String
      def icalendar_method
        method_property ? method_property.ruby_value : nil
      end

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


      # return the the PRODID property
      # which will be an instances of RiCal::PropertyValueText
      # 
      # [purpose (from RFC 2445)]
      # This property specifies the identifier for the product that created the iCalendar object.
      # 
      # see RFC 2445 4.7.3 pp 75-76
      def prodid_property
        @prodid_property ||= RiCal::PropertyValue::Text.convert(self, "-//com.denhaven2/NONSGML ri_cal gem//EN")
      end

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

      # set the value of the PRODID property
      def prodid=(ruby_value)
        self.prodid_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
      end

      # return the value of the PRODID property
      # which will be an instance of String
      def prodid
        prodid_property ? prodid_property.ruby_value : nil
      end

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


      # return the the VERSION property
      # which will be an instances of RiCal::PropertyValueText
      # 
      # [purpose (from RFC 2445)]
      # This property specifies the identifier corresponding to thehighest version number or the minimum and maximum range of the iCalendar specification that is required in order to interpret the iCalendar object.
      # 
      # see RFC 2445 4.7.4 pp 76-77
      def version_property
        @version_property ||= RiCal::PropertyValue::Text.convert(self, "2.0")
      end

      # return the value of the VERSION property
      # which will be an instance of String
      def version
        version_property ? version_property.ruby_value : nil
      end

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


      def export_properties_to(export_stream) #:nodoc:
        export_prop_to(export_stream, "CALSCALE", @calscale_property)
        export_prop_to(export_stream, "PRODID", @prodid_property)
        export_prop_to(export_stream, "VERSION", @version_property)
        export_prop_to(export_stream, "METHOD", @method_property)
      end

      def ==(o) #:nodoc:
        if o.class == self.class
        (calscale_property == o.calscale_property) &&
        (prodid_property == o.prodid_property) &&
        (version_property == o.version_property) &&
        (method_property == o.method_property)
        else
           super
        end
      end

      def initialize_copy(o) #:nodoc:
        super
        calscale_property = calscale_property && calscale_property.dup
        prodid_property = prodid_property && prodid_property.dup
        version_property = version_property && version_property.dup
        method_property = method_property && method_property.dup
      end

      def add_date_times_to(required_timezones) #:nodoc:
      end

      module ClassMethods #:nodoc:
        def property_parser #:nodoc:
          {"METHOD"=>:method_property_from_string, "VERSION"=>:version_property_from_string, "PRODID"=>:prodid_property_from_string, "CALSCALE"=>:calscale_property_from_string}
        end
      end

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

      def mutual_exclusion_violation #:nodoc:
        false
      end
    end
  end
end