icalendar 0.95 → 0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +9 -4
- data/Rakefile +4 -3
- data/docs/examples/parse_cal.rb +1 -1
- data/lib/icalendar/calendar.rb +15 -51
- data/lib/icalendar/component.rb +75 -21
- data/lib/icalendar/component/event.rb +60 -11
- data/lib/icalendar/component/timezone.rb +31 -7
- data/lib/icalendar/component/todo.rb +1 -1
- data/lib/icalendar/conversions.rb +3 -1
- data/lib/icalendar/foo.rb +394 -0
- data/lib/icalendar/parser.rb +29 -22
- data/test/calendar_test.rb +37 -37
- data/test/component/event_test.rb +1 -1
- data/test/component_test.rb +56 -56
- data/test/interactive.rb +15 -0
- data/test/life.ics +45 -0
- data/test/parameter_test.rb +20 -0
- metadata +23 -70
- data/docs/api/classes/Array.html +0 -146
- data/docs/api/classes/Date.html +0 -157
- data/docs/api/classes/DateTime.html +0 -178
- data/docs/api/classes/Fixnum.html +0 -146
- data/docs/api/classes/Float.html +0 -146
- data/docs/api/classes/Icalendar/Alarm.html +0 -184
- data/docs/api/classes/Icalendar/Base.html +0 -118
- data/docs/api/classes/Icalendar/Calendar.html +0 -411
- data/docs/api/classes/Icalendar/Component.html +0 -306
- data/docs/api/classes/Icalendar/DateProp.html +0 -187
- data/docs/api/classes/Icalendar/DateProp/ClassMethods.html +0 -195
- data/docs/api/classes/Icalendar/Event.html +0 -202
- data/docs/api/classes/Icalendar/Freebusy.html +0 -157
- data/docs/api/classes/Icalendar/InvalidComponentClass.html +0 -117
- data/docs/api/classes/Icalendar/InvalidPropertyValue.html +0 -117
- data/docs/api/classes/Icalendar/Journal.html +0 -190
- data/docs/api/classes/Icalendar/Parameter.html +0 -166
- data/docs/api/classes/Icalendar/Parser.html +0 -447
- data/docs/api/classes/Icalendar/Timezone.html +0 -197
- data/docs/api/classes/Icalendar/Todo.html +0 -199
- data/docs/api/classes/String.html +0 -160
- data/docs/api/classes/Time.html +0 -161
- data/docs/api/created.rid +0 -1
- data/docs/api/files/COPYING.html +0 -163
- data/docs/api/files/GPL.html +0 -531
- data/docs/api/files/README.html +0 -241
- data/docs/api/files/lib/icalendar/base_rb.html +0 -108
- data/docs/api/files/lib/icalendar/calendar_rb.html +0 -101
- data/docs/api/files/lib/icalendar/component/alarm_rb.html +0 -101
- data/docs/api/files/lib/icalendar/component/event_rb.html +0 -101
- data/docs/api/files/lib/icalendar/component/freebusy_rb.html +0 -101
- data/docs/api/files/lib/icalendar/component/journal_rb.html +0 -101
- data/docs/api/files/lib/icalendar/component/timezone_rb.html +0 -101
- data/docs/api/files/lib/icalendar/component/todo_rb.html +0 -101
- data/docs/api/files/lib/icalendar/component_rb.html +0 -101
- data/docs/api/files/lib/icalendar/conversions_rb.html +0 -108
- data/docs/api/files/lib/icalendar/helpers_rb.html +0 -101
- data/docs/api/files/lib/icalendar/parameter_rb.html +0 -101
- data/docs/api/files/lib/icalendar/parser_rb.html +0 -109
- data/docs/api/files/lib/icalendar_rb.html +0 -118
- data/docs/api/fr_class_index.html +0 -48
- data/docs/api/fr_file_index.html +0 -43
- data/docs/api/fr_method_index.html +0 -63
- data/docs/api/index.html +0 -24
- data/docs/api/rdoc-style.css +0 -208
- data/lib/icalendar/#helpers.rb# +0 -92
data/docs/api/classes/Array.html
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: Array</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">Array</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../files/lib/icalendar/conversions_rb.html">
|
|
59
|
-
lib/icalendar/conversions.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
Object
|
|
69
|
-
</td>
|
|
70
|
-
</tr>
|
|
71
|
-
</table>
|
|
72
|
-
</div>
|
|
73
|
-
<!-- banner header -->
|
|
74
|
-
|
|
75
|
-
<div id="bodyContent">
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<div id="contextContent">
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div id="method-list">
|
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
|
87
|
-
|
|
88
|
-
<div class="name-list">
|
|
89
|
-
<a href="#M000002">to_ical</a>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<!-- if includes -->
|
|
97
|
-
|
|
98
|
-
<div id="section">
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
<!-- if method_list -->
|
|
108
|
-
<div id="methods">
|
|
109
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
110
|
-
|
|
111
|
-
<div id="method-M000002" class="method-detail">
|
|
112
|
-
<a name="M000002"></a>
|
|
113
|
-
|
|
114
|
-
<div class="method-heading">
|
|
115
|
-
<a href="#M000002" class="method-signature">
|
|
116
|
-
<span class="method-name">to_ical</span><span class="method-args">()</span>
|
|
117
|
-
</a>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<div class="method-description">
|
|
121
|
-
<p><a class="source-toggle" href="#"
|
|
122
|
-
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
123
|
-
<div class="method-source-code" id="M000002-source">
|
|
124
|
-
<pre>
|
|
125
|
-
<span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 38</span>
|
|
126
|
-
38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
|
|
127
|
-
39: <span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">elem</span><span class="ruby-operator">|</span> <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">to_ical</span>}.<span class="ruby-identifier">join</span> <span class="ruby-value str">','</span>
|
|
128
|
-
40: <span class="ruby-keyword kw">end</span>
|
|
129
|
-
</pre>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
</div>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<div id="validator-badges">
|
|
142
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
</body>
|
|
146
|
-
</html>
|
data/docs/api/classes/Date.html
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: Date</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">Date</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../files/lib/icalendar/conversions_rb.html">
|
|
59
|
-
lib/icalendar/conversions.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
Object
|
|
69
|
-
</td>
|
|
70
|
-
</tr>
|
|
71
|
-
</table>
|
|
72
|
-
</div>
|
|
73
|
-
<!-- banner header -->
|
|
74
|
-
|
|
75
|
-
<div id="bodyContent">
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<div id="contextContent">
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div id="method-list">
|
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
|
87
|
-
|
|
88
|
-
<div class="name-list">
|
|
89
|
-
<a href="#M000004">to_ical</a>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<!-- if includes -->
|
|
97
|
-
|
|
98
|
-
<div id="section">
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
<!-- if method_list -->
|
|
108
|
-
<div id="methods">
|
|
109
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
110
|
-
|
|
111
|
-
<div id="method-M000004" class="method-detail">
|
|
112
|
-
<a name="M000004"></a>
|
|
113
|
-
|
|
114
|
-
<div class="method-heading">
|
|
115
|
-
<a href="#M000004" class="method-signature">
|
|
116
|
-
<span class="method-name">to_ical</span><span class="method-args">(utc = false)</span>
|
|
117
|
-
</a>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<div class="method-description">
|
|
121
|
-
<p><a class="source-toggle" href="#"
|
|
122
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
123
|
-
<div class="method-source-code" id="M000004-source">
|
|
124
|
-
<pre>
|
|
125
|
-
<span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 80</span>
|
|
126
|
-
80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>(<span class="ruby-identifier">utc</span> = <span class="ruby-keyword kw">false</span>)
|
|
127
|
-
81: <span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
|
128
|
-
82:
|
|
129
|
-
83: <span class="ruby-comment cmt"># 4 digit year</span>
|
|
130
|
-
84: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">year</span>.<span class="ruby-identifier">to_s</span>
|
|
131
|
-
85:
|
|
132
|
-
86: <span class="ruby-comment cmt"># Double digit month</span>
|
|
133
|
-
87: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
134
|
-
88: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span>.<span class="ruby-identifier">to_s</span>
|
|
135
|
-
89:
|
|
136
|
-
90: <span class="ruby-comment cmt"># Double digit day</span>
|
|
137
|
-
91: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
138
|
-
92: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span>.<span class="ruby-identifier">to_s</span>
|
|
139
|
-
93: <span class="ruby-keyword kw">end</span>
|
|
140
|
-
</pre>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
</div>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
</div>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<div id="validator-badges">
|
|
153
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
</body>
|
|
157
|
-
</html>
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: DateTime</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">DateTime</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../files/lib/icalendar/conversions_rb.html">
|
|
59
|
-
lib/icalendar/conversions.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
<a href="Date.html">
|
|
69
|
-
Date
|
|
70
|
-
</a>
|
|
71
|
-
</td>
|
|
72
|
-
</tr>
|
|
73
|
-
</table>
|
|
74
|
-
</div>
|
|
75
|
-
<!-- banner header -->
|
|
76
|
-
|
|
77
|
-
<div id="bodyContent">
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<div id="contextContent">
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<div id="method-list">
|
|
88
|
-
<h3 class="section-bar">Methods</h3>
|
|
89
|
-
|
|
90
|
-
<div class="name-list">
|
|
91
|
-
<a href="#M000005">to_ical</a>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<!-- if includes -->
|
|
99
|
-
|
|
100
|
-
<div id="section">
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<!-- if method_list -->
|
|
110
|
-
<div id="methods">
|
|
111
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
112
|
-
|
|
113
|
-
<div id="method-M000005" class="method-detail">
|
|
114
|
-
<a name="M000005"></a>
|
|
115
|
-
|
|
116
|
-
<div class="method-heading">
|
|
117
|
-
<a href="#M000005" class="method-signature">
|
|
118
|
-
<span class="method-name">to_ical</span><span class="method-args">(utc = false)</span>
|
|
119
|
-
</a>
|
|
120
|
-
</div>
|
|
121
|
-
|
|
122
|
-
<div class="method-description">
|
|
123
|
-
<p><a class="source-toggle" href="#"
|
|
124
|
-
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
|
125
|
-
<div class="method-source-code" id="M000005-source">
|
|
126
|
-
<pre>
|
|
127
|
-
<span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 44</span>
|
|
128
|
-
44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>(<span class="ruby-identifier">utc</span> = <span class="ruby-keyword kw">false</span>)
|
|
129
|
-
45: <span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
|
130
|
-
46:
|
|
131
|
-
47: <span class="ruby-comment cmt"># 4 digit year</span>
|
|
132
|
-
48: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">year</span>.<span class="ruby-identifier">to_s</span>
|
|
133
|
-
49:
|
|
134
|
-
50: <span class="ruby-comment cmt"># Double digit month</span>
|
|
135
|
-
51: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
136
|
-
52: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span>.<span class="ruby-identifier">to_s</span>
|
|
137
|
-
53:
|
|
138
|
-
54: <span class="ruby-comment cmt"># Double digit day</span>
|
|
139
|
-
55: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
140
|
-
56: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span>.<span class="ruby-identifier">to_s</span>
|
|
141
|
-
57:
|
|
142
|
-
58: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"T"</span>
|
|
143
|
-
59:
|
|
144
|
-
60: <span class="ruby-comment cmt"># Double digit hour</span>
|
|
145
|
-
61: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hour</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
146
|
-
62: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hour</span>.<span class="ruby-identifier">to_s</span>
|
|
147
|
-
63:
|
|
148
|
-
64: <span class="ruby-comment cmt"># Double digit minute</span>
|
|
149
|
-
65: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
150
|
-
66: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min</span>.<span class="ruby-identifier">to_s</span>
|
|
151
|
-
67:
|
|
152
|
-
68: <span class="ruby-comment cmt"># Double digit second</span>
|
|
153
|
-
69: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sec</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
154
|
-
70: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sec</span>.<span class="ruby-identifier">to_s</span>
|
|
155
|
-
71:
|
|
156
|
-
72: <span class="ruby-comment cmt"># UTC time gets a Z suffix</span>
|
|
157
|
-
73: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">utc</span>
|
|
158
|
-
74: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"Z"</span>
|
|
159
|
-
75: <span class="ruby-keyword kw">end</span>
|
|
160
|
-
76: <span class="ruby-keyword kw">end</span>
|
|
161
|
-
</pre>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
</div>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
</div>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<div id="validator-badges">
|
|
174
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
175
|
-
</div>
|
|
176
|
-
|
|
177
|
-
</body>
|
|
178
|
-
</html>
|