icalendar 0.96 → 0.96.1
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 +3 -3
- data/Rakefile +3 -4
- data/docs/api/classes/Array.html +148 -0
- data/docs/api/classes/Date.html +159 -0
- data/docs/api/classes/DateTime.html +180 -0
- data/docs/api/classes/Fixnum.html +148 -0
- data/docs/api/classes/Float.html +148 -0
- data/docs/api/classes/HashAttrs.html +199 -0
- data/docs/api/classes/Icalendar/Alarm.html +228 -0
- data/docs/api/classes/Icalendar/Base.html +120 -0
- data/docs/api/classes/Icalendar/Calendar.html +365 -0
- data/docs/api/classes/Icalendar/Component.html +689 -0
- data/docs/api/classes/Icalendar/DateProp.html +187 -0
- data/docs/api/classes/Icalendar/DateProp/ClassMethods.html +195 -0
- data/docs/api/classes/Icalendar/Daylight.html +156 -0
- data/docs/api/classes/Icalendar/Event.html +650 -0
- data/docs/api/classes/Icalendar/Freebusy.html +297 -0
- data/docs/api/classes/Icalendar/InvalidPropertyValue.html +117 -0
- data/docs/api/classes/Icalendar/Journal.html +459 -0
- data/docs/api/classes/Icalendar/Parameter.html +166 -0
- data/docs/api/classes/Icalendar/Parser.html +447 -0
- data/docs/api/classes/Icalendar/Standard.html +156 -0
- data/docs/api/classes/Icalendar/Timezone.html +351 -0
- data/docs/api/classes/Icalendar/Todo.html +496 -0
- data/docs/api/classes/Icalendar/UnknownComponentClass.html +117 -0
- data/docs/api/classes/Icalendar/UnknownPropertyMethod.html +117 -0
- data/docs/api/classes/Object.html +270 -0
- data/docs/api/classes/String.html +148 -0
- data/docs/api/classes/Time.html +163 -0
- data/docs/api/classes/URI.html +111 -0
- data/docs/api/classes/URI/Generic.html +148 -0
- data/docs/api/created.rid +1 -0
- data/docs/api/files/COPYING.html +163 -0
- data/docs/api/files/GPL.html +531 -0
- data/docs/api/files/README.html +254 -0
- data/docs/api/files/lib/hash_attrs_rb.html +107 -0
- data/docs/api/files/lib/icalendar/base_rb.html +108 -0
- data/docs/api/files/lib/icalendar/calendar_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/alarm_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/event_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/freebusy_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/journal_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/timezone_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/todo_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component_rb.html +101 -0
- data/docs/api/files/lib/icalendar/conversions_rb.html +109 -0
- data/docs/api/files/lib/icalendar/helpers_rb.html +101 -0
- data/docs/api/files/lib/icalendar/parameter_rb.html +101 -0
- data/docs/api/files/lib/icalendar/parser_rb.html +109 -0
- data/docs/api/files/lib/icalendar_rb.html +120 -0
- data/docs/api/files/lib/meta_rb.html +107 -0
- data/docs/api/fr_class_index.html +55 -0
- data/docs/api/fr_file_index.html +45 -0
- data/docs/api/fr_method_index.html +79 -0
- data/docs/api/index.html +24 -0
- data/docs/api/rdoc-style.css +208 -0
- data/{docs/examples → examples}/create_cal.rb +6 -2
- data/{docs/examples → examples}/parse_cal.rb +3 -2
- data/{docs/examples → examples}/single_event.ics +0 -0
- data/lib/hash_attrs.rb +29 -0
- data/lib/icalendar.rb +11 -2
- data/lib/icalendar/base.rb +6 -2
- data/lib/icalendar/calendar.rb +1 -1
- data/lib/icalendar/component.rb +98 -71
- data/lib/icalendar/component/alarm.rb +5 -3
- data/lib/icalendar/component/event.rb +1 -1
- data/lib/icalendar/component/freebusy.rb +23 -23
- data/lib/icalendar/component/journal.rb +1 -5
- data/lib/icalendar/component/timezone.rb +7 -0
- data/lib/icalendar/component/todo.rb +1 -6
- data/lib/icalendar/conversions.rb +10 -0
- data/lib/icalendar/parser.rb +82 -85
- data/lib/meta.rb +32 -0
- data/test/component_test.rb +69 -64
- metadata +74 -12
- data/lib/icalendar/foo.rb +0 -394
- data/test/property_helpers.rb +0 -35
data/README
CHANGED
|
@@ -110,9 +110,9 @@ Documentation can be found at
|
|
|
110
110
|
|
|
111
111
|
== Installation
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
This library uses rubygems for distribution and installation:
|
|
114
|
+
|
|
115
|
+
$ gem install icalendar
|
|
116
116
|
|
|
117
117
|
== License
|
|
118
118
|
|
data/Rakefile
CHANGED
|
@@ -3,7 +3,7 @@ require 'rake'
|
|
|
3
3
|
require 'rake/testtask'
|
|
4
4
|
require 'rake/rdoctask'
|
|
5
5
|
|
|
6
|
-
PKG_VERSION = "0.96"
|
|
6
|
+
PKG_VERSION = "0.96.1"
|
|
7
7
|
|
|
8
8
|
$VERBOSE = nil
|
|
9
9
|
TEST_CHANGES_SINCE = Time.now - 600 # Recent tests = changed in last 10 minutes
|
|
@@ -47,9 +47,8 @@ Rake::RDocTask.new(:doc) { |rdoc|
|
|
|
47
47
|
rdoc.rdoc_files.include('GPL', 'COPYING')
|
|
48
48
|
rdoc.rdoc_dir = 'docs/api'
|
|
49
49
|
rdoc.title = "iCalendar -- Internet Calendaring for Ruby"
|
|
50
|
-
rdoc.options << "--include examples/ --line-numbers --inline-source
|
|
51
|
-
|
|
52
|
-
rdoc.options << "--accessor=ical_property,ical_multi_property"
|
|
50
|
+
rdoc.options << "--include examples/ --line-numbers --inline-source"
|
|
51
|
+
rdoc.options << "--accessor=ical_component,ical_property,ical_multi_property"
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
Gem::manage_gems
|
|
@@ -0,0 +1,148 @@
|
|
|
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
|
+
<a href="Object.html">
|
|
69
|
+
Object
|
|
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="#M000002">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-M000002" class="method-detail">
|
|
114
|
+
<a name="M000002"></a>
|
|
115
|
+
|
|
116
|
+
<div class="method-heading">
|
|
117
|
+
<a href="#M000002" class="method-signature">
|
|
118
|
+
<span class="method-name">to_ical</span><span class="method-args">()</span>
|
|
119
|
+
</a>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<div class="method-description">
|
|
123
|
+
<p><a class="source-toggle" href="#"
|
|
124
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
125
|
+
<div class="method-source-code" id="M000002-source">
|
|
126
|
+
<pre>
|
|
127
|
+
<span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 40</span>
|
|
128
|
+
40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
|
|
129
|
+
41: <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>
|
|
130
|
+
42: <span class="ruby-keyword kw">end</span>
|
|
131
|
+
</pre>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<div id="validator-badges">
|
|
144
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
</body>
|
|
148
|
+
</html>
|
|
@@ -0,0 +1,159 @@
|
|
|
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
|
+
<a href="Object.html">
|
|
69
|
+
Object
|
|
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="#M000004">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-M000004" class="method-detail">
|
|
114
|
+
<a name="M000004"></a>
|
|
115
|
+
|
|
116
|
+
<div class="method-heading">
|
|
117
|
+
<a href="#M000004" 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('M000004-source');return false;">[Source]</a></p>
|
|
125
|
+
<div class="method-source-code" id="M000004-source">
|
|
126
|
+
<pre>
|
|
127
|
+
<span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 92</span>
|
|
128
|
+
92: <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
|
+
93: <span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
|
130
|
+
94:
|
|
131
|
+
95: <span class="ruby-comment cmt"># 4 digit year</span>
|
|
132
|
+
96: <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
|
+
97:
|
|
134
|
+
98: <span class="ruby-comment cmt"># Double digit month</span>
|
|
135
|
+
99: <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
|
+
100: <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
|
+
101:
|
|
138
|
+
102: <span class="ruby-comment cmt"># Double digit day</span>
|
|
139
|
+
103: <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
|
+
104: <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
|
+
105: <span class="ruby-keyword kw">end</span>
|
|
142
|
+
</pre>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
<div id="validator-badges">
|
|
155
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
</body>
|
|
159
|
+
</html>
|
|
@@ -0,0 +1,180 @@
|
|
|
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 54</span>
|
|
128
|
+
54: <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
|
+
55: <span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
|
130
|
+
56:
|
|
131
|
+
57: <span class="ruby-comment cmt"># 4 digit year</span>
|
|
132
|
+
58: <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
|
+
59:
|
|
134
|
+
60: <span class="ruby-comment cmt"># Double digit month</span>
|
|
135
|
+
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">month</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
136
|
+
62: <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
|
+
63:
|
|
138
|
+
64: <span class="ruby-comment cmt"># Double digit day</span>
|
|
139
|
+
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">day</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
|
140
|
+
66: <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
|
+
67:
|
|
142
|
+
68: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"T"</span>
|
|
143
|
+
69:
|
|
144
|
+
70: <span class="ruby-comment cmt"># Double digit hour</span>
|
|
145
|
+
71: <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
|
+
72: <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
|
+
73:
|
|
148
|
+
74: <span class="ruby-comment cmt"># Double digit minute</span>
|
|
149
|
+
75: <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
|
+
76: <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
|
+
77:
|
|
152
|
+
78: <span class="ruby-comment cmt"># Double digit second</span>
|
|
153
|
+
79: <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
|
+
80: <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
|
+
81:
|
|
156
|
+
82: <span class="ruby-comment cmt"># UTC time gets a Z suffix</span>
|
|
157
|
+
83: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">utc</span>
|
|
158
|
+
84: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"Z"</span>
|
|
159
|
+
85: <span class="ruby-keyword kw">end</span>
|
|
160
|
+
86:
|
|
161
|
+
87: <span class="ruby-identifier">s</span>
|
|
162
|
+
88: <span class="ruby-keyword kw">end</span>
|
|
163
|
+
</pre>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
<div id="validator-badges">
|
|
176
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
177
|
+
</div>
|
|
178
|
+
|
|
179
|
+
</body>
|
|
180
|
+
</html>
|