icalendar 0.96.4 → 0.97
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 +66 -53
- data/Rakefile +33 -24
- data/docs/api/classes/Array.html +9 -11
- data/docs/api/classes/Array.src/M000002.html +18 -0
- data/docs/api/classes/Date.html +2 -22
- data/docs/api/classes/Date.src/M000004.html +29 -0
- data/docs/api/classes/DateTime.html +2 -43
- data/docs/api/classes/DateTime.src/M000005.html +50 -0
- data/docs/api/classes/Fixnum.html +2 -11
- data/docs/api/classes/Fixnum.src/M000011.html +18 -0
- data/docs/api/classes/Float.html +2 -11
- data/docs/api/classes/Float.src/M000003.html +18 -0
- data/docs/api/classes/HashAttrs.html +15 -60
- data/docs/api/classes/HashAttrs.src/M000068.html +26 -0
- data/docs/api/classes/HashAttrs.src/M000069.html +27 -0
- data/docs/api/classes/HashAttrs.src/M000070.html +19 -0
- data/docs/api/classes/Icalendar/Alarm.html +5 -15
- data/docs/api/classes/Icalendar/Alarm.src/M000020.html +22 -0
- data/docs/api/classes/Icalendar/Base.html +41 -0
- data/docs/api/classes/Icalendar/Base.src/M000022.html +18 -0
- data/docs/api/classes/Icalendar/Base.src/M000023.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.html +116 -116
- data/docs/api/classes/Icalendar/Calendar.src/M000054.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000055.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000056.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000057.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000058.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000059.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000060.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000061.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000062.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000063.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000064.html +19 -0
- data/docs/api/classes/Icalendar/Component.html +200 -367
- data/docs/api/classes/Icalendar/Component.src/M000029.html +22 -0
- data/docs/api/classes/Icalendar/Component.src/M000030.html +24 -0
- data/docs/api/classes/Icalendar/Component.src/M000035.html +22 -0
- data/docs/api/classes/Icalendar/Component.src/M000040.html +18 -0
- data/docs/api/classes/Icalendar/Component.src/M000041.html +24 -0
- data/docs/api/classes/Icalendar/Component.src/M000042.html +28 -0
- data/docs/api/classes/Icalendar/Component.src/M000043.html +37 -0
- data/docs/api/classes/Icalendar/Component.src/M000044.html +37 -0
- data/docs/api/classes/Icalendar/Component.src/M000045.html +18 -0
- data/docs/api/classes/Icalendar/Component.src/M000046.html +18 -0
- data/docs/api/classes/Icalendar/Component.src/M000047.html +18 -0
- data/docs/api/classes/Icalendar/Component.src/M000048.html +26 -0
- data/docs/api/classes/Icalendar/Component.src/M000049.html +29 -0
- data/docs/api/classes/Icalendar/Component.src/M000050.html +22 -0
- data/docs/api/classes/Icalendar/DateProp.html +2 -12
- data/docs/api/classes/Icalendar/DateProp.src/M000013.html +19 -0
- data/docs/api/classes/Icalendar/DateProp/ClassMethods.html +2 -59
- data/docs/api/classes/Icalendar/DateProp/ClassMethods.src/M000014.html +66 -0
- data/docs/api/classes/Icalendar/Daylight.html +5 -14
- data/docs/api/classes/Icalendar/Daylight.src/M000051.html +18 -0
- data/docs/api/classes/Icalendar/Event.html +30 -37
- data/docs/api/classes/Icalendar/Event.src/M000052.html +23 -0
- data/docs/api/classes/Icalendar/Event.src/M000053.html +23 -0
- data/docs/api/classes/Icalendar/Freebusy.html +5 -14
- data/docs/api/classes/Icalendar/Freebusy.src/M000065.html +21 -0
- data/docs/api/classes/Icalendar/Geo.html +192 -0
- data/docs/api/classes/Icalendar/Geo.src/M000024.html +19 -0
- data/docs/api/classes/Icalendar/Geo.src/M000025.html +18 -0
- data/docs/api/classes/Icalendar/Journal.html +2 -11
- data/docs/api/classes/Icalendar/Journal.src/M000016.html +22 -0
- data/docs/api/classes/Icalendar/Parameter.html +5 -23
- data/docs/api/classes/Icalendar/Parameter.src/M000066.html +27 -0
- data/docs/api/classes/Icalendar/Parser.html +36 -212
- data/docs/api/classes/Icalendar/Parser.src/M000017.html +32 -0
- data/docs/api/classes/Icalendar/Parser.src/M000018.html +43 -0
- data/docs/api/classes/Icalendar/Parser.src/M000019.html +33 -0
- data/docs/api/classes/Icalendar/Standard.html +2 -11
- data/docs/api/classes/Icalendar/Standard.src/M000015.html +18 -0
- data/docs/api/classes/Icalendar/Timezone.html +16 -48
- data/docs/api/classes/Icalendar/Timezone.src/M000026.html +19 -0
- data/docs/api/classes/Icalendar/Timezone.src/M000027.html +22 -0
- data/docs/api/classes/Icalendar/Timezone.src/M000028.html +18 -0
- data/docs/api/classes/Icalendar/Todo.html +5 -14
- data/docs/api/classes/Icalendar/Todo.src/M000021.html +22 -0
- data/docs/api/classes/Object.html +10 -59
- data/docs/api/classes/Object.src/M000006.html +20 -0
- data/docs/api/classes/Object.src/M000007.html +18 -0
- data/docs/api/classes/Object.src/M000008.html +20 -0
- data/docs/api/classes/Object.src/M000009.html +18 -0
- data/docs/api/classes/Object.src/M000010.html +18 -0
- data/docs/api/classes/String.html +2 -11
- data/docs/api/classes/String.src/M000012.html +18 -0
- data/docs/api/classes/Time.html +2 -26
- data/docs/api/classes/Time.src/M000001.html +37 -0
- data/docs/api/classes/URI/Generic.html +5 -14
- data/docs/api/classes/URI/Generic.src/M000067.html +18 -0
- data/docs/api/created.rid +1 -1
- data/docs/api/files/COPYING.html +1 -1
- data/docs/api/files/GPL.html +1 -1
- data/docs/api/files/README.html +76 -64
- data/docs/api/files/lib/hash_attrs_rb.html +1 -1
- data/docs/api/files/lib/icalendar/base_rb.html +1 -1
- data/docs/api/files/lib/icalendar/calendar_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/alarm_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/event_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/freebusy_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/journal_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/timezone_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/todo_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component_rb.html +8 -1
- data/docs/api/files/lib/icalendar/conversions_rb.html +1 -1
- data/docs/api/files/lib/icalendar/helpers_rb.html +1 -1
- data/docs/api/files/lib/icalendar/parameter_rb.html +1 -1
- data/docs/api/files/lib/icalendar/parser_rb.html +2 -1
- data/docs/api/files/lib/icalendar_rb.html +1 -1
- data/docs/api/files/lib/meta_rb.html +1 -1
- data/docs/api/fr_class_index.html +1 -0
- data/docs/api/fr_method_index.html +57 -41
- data/docs/rfcs/itip_notes.txt +69 -0
- data/examples/create_cal.rb +33 -32
- data/examples/parse_cal.rb +2 -2
- data/lib/icalendar/base.rb +8 -0
- data/lib/icalendar/calendar.rb +32 -3
- data/lib/icalendar/component.rb +187 -113
- data/lib/icalendar/component/alarm.rb +3 -0
- data/lib/icalendar/component/event.rb +9 -3
- data/lib/icalendar/component/freebusy.rb +3 -0
- data/lib/icalendar/component/journal.rb +4 -0
- data/lib/icalendar/component/todo.rb +4 -0
- data/lib/icalendar/conversions.rb +7 -1
- data/lib/icalendar/parser.rb +68 -90
- data/test/calendar_test.rb +32 -8
- data/test/component/event_test.rb +4 -7
- data/test/component/todo_test.rb +13 -0
- data/test/component_test.rb +21 -34
- data/test/conversions_test.rb +66 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-hash_attrs_rb.html +574 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-base_rb.html +575 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-calendar_rb.html +629 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-alarm_rb.html +581 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-event_rb.html +658 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-freebusy_rb.html +574 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-journal_rb.html +597 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-timezone_rb.html +625 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-todo_rb.html +600 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component_rb.html +924 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-conversions_rb.html +667 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-parser_rb.html +938 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar_rb.html +576 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-meta_rb.html +572 -0
- data/test/coverage/calendar_test_rb.html +590 -0
- data/test/coverage/component_test_rb.html +602 -0
- data/test/coverage/index.html +1009 -0
- data/test/coverage/lib-hash_attrs_rb.html +574 -0
- data/test/coverage/lib-icalendar-base_rb.html +583 -0
- data/test/coverage/lib-icalendar-calendar_rb.html +631 -0
- data/test/coverage/lib-icalendar-component-alarm_rb.html +581 -0
- data/test/coverage/lib-icalendar-component-event_rb.html +661 -0
- data/test/coverage/lib-icalendar-component-freebusy_rb.html +576 -0
- data/test/coverage/lib-icalendar-component-journal_rb.html +599 -0
- data/test/coverage/lib-icalendar-component-timezone_rb.html +625 -0
- data/test/coverage/lib-icalendar-component-todo_rb.html +602 -0
- data/test/coverage/lib-icalendar-component_rb.html +941 -0
- data/test/coverage/lib-icalendar-conversions_rb.html +673 -0
- data/test/coverage/lib-icalendar-parser_rb.html +916 -0
- data/test/coverage/lib-icalendar_rb.html +576 -0
- data/test/coverage/lib-meta_rb.html +572 -0
- data/test/coverage/parameter_test_rb.html +569 -0
- data/test/coverage/parser_test_rb.html +623 -0
- data/test/coverage/test-calendar_test_rb.html +590 -0
- data/test/coverage/test-component-event_test_rb.html +584 -0
- data/test/coverage/test-component_test_rb.html +606 -0
- data/test/coverage/test-conversions_test_rb.html +603 -0
- data/test/coverage/test-parameter_test_rb.html +569 -0
- data/test/coverage/test-parser_test_rb.html +624 -0
- data/test/interactive.rb +3 -1
- data/test/life.ics +46 -1092
- data/test/parameter_test.rb +11 -2
- data/test/parser_test.rb +12 -11
- metadata +259 -126
- data/test/old_life.ics +0 -46
- data/test/rw.ics +0 -947
|
@@ -0,0 +1,23 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>new (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 19</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>()
|
|
15
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-value str">"VCALENDAR"</span>)
|
|
16
|
+
|
|
17
|
+
<span class="ruby-comment cmt"># Set some defaults</span>
|
|
18
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">calscale</span> = <span class="ruby-value str">"GREGORIAN"</span> <span class="ruby-comment cmt"># Who knows, but this is the only one in the spec.</span>
|
|
19
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">prodid</span> = <span class="ruby-value str">"iCalendar-Ruby"</span> <span class="ruby-comment cmt"># Current product... Should be overwritten by apps that use the library</span>
|
|
20
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span> = <span class="ruby-value str">"2.0"</span> <span class="ruby-comment cmt"># Version of the specification</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>event (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 28</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">event</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-constant">Event</span>.<span class="ruby-identifier">new</span>
|
|
16
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_component</span> <span class="ruby-identifier">e</span>
|
|
17
|
+
|
|
18
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
|
|
19
|
+
|
|
20
|
+
<span class="ruby-identifier">e</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>find_event (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 37</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_event</span>(<span class="ruby-identifier">uid</span>)
|
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">events</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uid</span>}
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>todo (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 41</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">todo</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-constant">Todo</span>.<span class="ruby-identifier">new</span>
|
|
16
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_component</span> <span class="ruby-identifier">e</span>
|
|
17
|
+
|
|
18
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
|
|
19
|
+
|
|
20
|
+
<span class="ruby-identifier">e</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>find_todo (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 50</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_todo</span>(<span class="ruby-identifier">uid</span>)
|
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">todos</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uid</span>}
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>journal (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 54</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">journal</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-constant">Journal</span>.<span class="ruby-identifier">new</span>
|
|
16
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_component</span> <span class="ruby-identifier">e</span>
|
|
17
|
+
|
|
18
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
|
|
19
|
+
|
|
20
|
+
<span class="ruby-identifier">e</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>find_journal (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 63</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_journal</span>(<span class="ruby-identifier">uid</span>)
|
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">journals</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span> <span class="ruby-identifier">j</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uid</span>}
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>freebusy (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 67</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">freebusy</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-constant">Freebusy</span>.<span class="ruby-identifier">new</span>
|
|
16
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_component</span> <span class="ruby-identifier">e</span>
|
|
17
|
+
|
|
18
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
|
|
19
|
+
|
|
20
|
+
<span class="ruby-identifier">e</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>find_freebusy (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 76</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_freebusy</span>(<span class="ruby-identifier">uid</span>)
|
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">freebusys</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uid</span>}
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>timezone (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 80</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">timezone</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-constant">Timezone</span>.<span class="ruby-identifier">new</span>
|
|
16
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_component</span> <span class="ruby-identifier">e</span>
|
|
17
|
+
|
|
18
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
|
|
19
|
+
|
|
20
|
+
<span class="ruby-identifier">e</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>publish (Icalendar::Calendar)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 98</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">publish</span>
|
|
15
|
+
<span class="ruby-identifier">ip_method</span> = <span class="ruby-value str">"PUBLISH"</span>
|
|
16
|
+
|
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -102,20 +102,28 @@ an <a href="Alarm.html">Alarm</a>.
|
|
|
102
102
|
<h3 class="section-bar">Methods</h3>
|
|
103
103
|
|
|
104
104
|
<div class="name-list">
|
|
105
|
-
<a href="#
|
|
106
|
-
<a href="#
|
|
107
|
-
<a href="#
|
|
108
|
-
<a href="#
|
|
109
|
-
<a href="#
|
|
110
|
-
<a href="#
|
|
111
|
-
<a href="#
|
|
112
|
-
<a href="#
|
|
113
|
-
<a href="#
|
|
114
|
-
<a href="#
|
|
115
|
-
<a href="#
|
|
116
|
-
<a href="#
|
|
117
|
-
<a href="#
|
|
118
|
-
<a href="#
|
|
105
|
+
<a href="#M000031">add</a>
|
|
106
|
+
<a href="#M000030">add_component</a>
|
|
107
|
+
<a href="#M000032">add_event</a>
|
|
108
|
+
<a href="#M000034">add_journal</a>
|
|
109
|
+
<a href="#M000033">add_todo</a>
|
|
110
|
+
<a href="#M000045">custom_property</a>
|
|
111
|
+
<a href="#M000047">ical_component</a>
|
|
112
|
+
<a href="#M000049">ical_multi_property</a>
|
|
113
|
+
<a href="#M000048">ical_property</a>
|
|
114
|
+
<a href="#M000046">multi_property?</a>
|
|
115
|
+
<a href="#M000029">new</a>
|
|
116
|
+
<a href="#M000040">new_uid</a>
|
|
117
|
+
<a href="#M000042">print_component</a>
|
|
118
|
+
<a href="#M000044">print_parameters</a>
|
|
119
|
+
<a href="#M000043">print_properties</a>
|
|
120
|
+
<a href="#M000036">remove</a>
|
|
121
|
+
<a href="#M000035">remove_component</a>
|
|
122
|
+
<a href="#M000037">remove_event</a>
|
|
123
|
+
<a href="#M000039">remove_journal</a>
|
|
124
|
+
<a href="#M000038">remove_todo</a>
|
|
125
|
+
<a href="#M000050">respond_to?</a>
|
|
126
|
+
<a href="#M000041">to_ical</a>
|
|
119
127
|
</div>
|
|
120
128
|
</div>
|
|
121
129
|
|
|
@@ -145,11 +153,6 @@ an <a href="Alarm.html">Alarm</a>.
|
|
|
145
153
|
<td class="context-item-value"> [RW] </td>
|
|
146
154
|
<td class="context-item-desc"></td>
|
|
147
155
|
</tr>
|
|
148
|
-
<tr class="top-aligned-row context-row">
|
|
149
|
-
<td class="context-item-name">property_params</td>
|
|
150
|
-
<td class="context-item-value"> [RW] </td>
|
|
151
|
-
<td class="context-item-desc"></td>
|
|
152
|
-
</tr>
|
|
153
156
|
</table>
|
|
154
157
|
</div>
|
|
155
158
|
</div>
|
|
@@ -160,41 +163,28 @@ an <a href="Alarm.html">Alarm</a>.
|
|
|
160
163
|
<div id="methods">
|
|
161
164
|
<h3 class="section-bar">Public Class methods</h3>
|
|
162
165
|
|
|
163
|
-
<div id="method-
|
|
164
|
-
<a name="
|
|
166
|
+
<div id="method-M000029" class="method-detail">
|
|
167
|
+
<a name="M000029"></a>
|
|
165
168
|
|
|
166
169
|
<div class="method-heading">
|
|
167
|
-
<a href="
|
|
170
|
+
<a href="Component.src/M000029.html" target="Code" class="method-signature"
|
|
171
|
+
onclick="popupCode('Component.src/M000029.html');return false;">
|
|
168
172
|
<span class="method-name">new</span><span class="method-args">(name)</span>
|
|
169
173
|
</a>
|
|
170
174
|
</div>
|
|
171
175
|
|
|
172
176
|
<div class="method-description">
|
|
173
|
-
<p><a class="source-toggle" href="#"
|
|
174
|
-
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
|
175
|
-
<div class="method-source-code" id="M000026-source">
|
|
176
|
-
<pre>
|
|
177
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 26</span>
|
|
178
|
-
26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>)
|
|
179
|
-
27: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
|
|
180
|
-
28: <span class="ruby-ivar">@components</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>([])
|
|
181
|
-
29: <span class="ruby-ivar">@properties</span> = {}
|
|
182
|
-
30: <span class="ruby-ivar">@property_params</span> = {}
|
|
183
|
-
31:
|
|
184
|
-
32: <span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">"New #{@name[1,@name.size].capitalize}..."</span>)
|
|
185
|
-
33: <span class="ruby-keyword kw">end</span>
|
|
186
|
-
</pre>
|
|
187
|
-
</div>
|
|
188
177
|
</div>
|
|
189
178
|
</div>
|
|
190
179
|
|
|
191
180
|
<h3 class="section-bar">Protected Class methods</h3>
|
|
192
181
|
|
|
193
|
-
<div id="method-
|
|
194
|
-
<a name="
|
|
182
|
+
<div id="method-M000047" class="method-detail">
|
|
183
|
+
<a name="M000047"></a>
|
|
195
184
|
|
|
196
185
|
<div class="method-heading">
|
|
197
|
-
<a href="
|
|
186
|
+
<a href="Component.src/M000047.html" target="Code" class="method-signature"
|
|
187
|
+
onclick="popupCode('Component.src/M000047.html');return false;">
|
|
198
188
|
<span class="method-name">ical_component</span><span class="method-args">(*syms)</span>
|
|
199
189
|
</a>
|
|
200
190
|
</div>
|
|
@@ -203,24 +193,15 @@ an <a href="Alarm.html">Alarm</a>.
|
|
|
203
193
|
<p>
|
|
204
194
|
Make it protected so we can monitor usage…
|
|
205
195
|
</p>
|
|
206
|
-
<p><a class="source-toggle" href="#"
|
|
207
|
-
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
|
208
|
-
<div class="method-source-code" id="M000035-source">
|
|
209
|
-
<pre>
|
|
210
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 130</span>
|
|
211
|
-
130: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_component</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>)
|
|
212
|
-
131: <span class="ruby-identifier">hash_accessor</span> <span class="ruby-identifier">:@components</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>
|
|
213
|
-
132: <span class="ruby-keyword kw">end</span>
|
|
214
|
-
</pre>
|
|
215
|
-
</div>
|
|
216
196
|
</div>
|
|
217
197
|
</div>
|
|
218
198
|
|
|
219
|
-
<div id="method-
|
|
220
|
-
<a name="
|
|
199
|
+
<div id="method-M000049" class="method-detail">
|
|
200
|
+
<a name="M000049"></a>
|
|
221
201
|
|
|
222
202
|
<div class="method-heading">
|
|
223
|
-
<a href="
|
|
203
|
+
<a href="Component.src/M000049.html" target="Code" class="method-signature"
|
|
204
|
+
onclick="popupCode('Component.src/M000049.html');return false;">
|
|
224
205
|
<span class="method-name">ical_multi_property</span><span class="method-args">(property, singular, plural)</span>
|
|
225
206
|
</a>
|
|
226
207
|
</div>
|
|
@@ -230,74 +211,15 @@ Make it protected so we can monitor usage…
|
|
|
230
211
|
Define a set of methods defining a new property, which supports multiple
|
|
231
212
|
values for the same property name.
|
|
232
213
|
</p>
|
|
233
|
-
<p><a class="source-toggle" href="#"
|
|
234
|
-
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
|
235
|
-
<div class="method-source-code" id="M000037-source">
|
|
236
|
-
<pre>
|
|
237
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 202</span>
|
|
238
|
-
202: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_multi_property</span>(<span class="ruby-identifier">property</span>, <span class="ruby-identifier">singular</span>, <span class="ruby-identifier">plural</span>)
|
|
239
|
-
203: <span class="ruby-identifier">property</span> = <span class="ruby-node">"#{property}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">upcase</span>
|
|
240
|
-
204: <span class="ruby-identifier">singular</span> = <span class="ruby-node">"#{singular}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
|
241
|
-
205: <span class="ruby-identifier">plural</span> = <span class="ruby-node">"#{plural}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
|
242
|
-
206:
|
|
243
|
-
207: <span class="ruby-identifier">getter</span> = <span class="ruby-node">"#{plural}"</span>
|
|
244
|
-
208: <span class="ruby-identifier">setter</span> = <span class="ruby-node">"#{plural}="</span>
|
|
245
|
-
209: <span class="ruby-identifier">adder</span> = <span class="ruby-node">"add_#{singular}"</span>
|
|
246
|
-
210: <span class="ruby-identifier">remover</span> = <span class="ruby-node">"remove_#{singular}"</span>
|
|
247
|
-
211: <span class="ruby-identifier">query</span> = <span class="ruby-node">"#{plural}?"</span>
|
|
248
|
-
212:
|
|
249
|
-
213: <span class="ruby-comment cmt"># Set this key so the parser knows to use an array for</span>
|
|
250
|
-
214: <span class="ruby-comment cmt"># storing this property type.</span>
|
|
251
|
-
215: <span class="ruby-ivar">@@multi_properties</span>[<span class="ruby-node">"#{property}"</span>] = <span class="ruby-keyword kw">true</span>
|
|
252
|
-
216:
|
|
253
|
-
217: <span class="ruby-comment cmt"># Getter for whole array</span>
|
|
254
|
-
218: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">getter</span>
|
|
255
|
-
219: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{getter}(*a)\nif a.empty?\nif @properties.has_key?(\"\#{property}\")\n@properties[\"\#{property}\"]\nelse\n[]\nend\nelse\nself.\#{setter}(a.first)\nend\nend\n"</span>
|
|
256
|
-
220:
|
|
257
|
-
221: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">186</span>
|
|
258
|
-
222: <span class="ruby-keyword kw">end</span>
|
|
259
|
-
223:
|
|
260
|
-
224: <span class="ruby-comment cmt"># Setter for whole array</span>
|
|
261
|
-
225: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">setter</span>
|
|
262
|
-
226: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{setter}(a)\nif a.respond_to?(:to_ary)\na.to_ary.each do |val|\nunless val.respond_to?(:to_ical)\nraise(NotImplementedError, \"Property values do not support to_ical method!\")\nend\nend\n\n@properties[\"\#{property}\"] = a.to_ary\n\nelse\nraise ArgumentError, \"\#{getter} is a multi-property that must be an array! Use the \#{adder} method to add single entries.\"\nend\nend\n"</span>
|
|
263
|
-
227:
|
|
264
|
-
228: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">198</span>
|
|
265
|
-
229: <span class="ruby-keyword kw">end</span>
|
|
266
|
-
230:
|
|
267
|
-
231: <span class="ruby-comment cmt"># Query for any of these properties</span>
|
|
268
|
-
232: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">query</span>
|
|
269
|
-
233: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{query}\n@properties.has_key?(\"\#{property}\")\nend\n"</span>
|
|
270
|
-
234:
|
|
271
|
-
235: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">210</span>
|
|
272
|
-
236: <span class="ruby-keyword kw">end</span>
|
|
273
|
-
237:
|
|
274
|
-
238: <span class="ruby-comment cmt"># Add another item to this properties array</span>
|
|
275
|
-
239: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">adder</span>
|
|
276
|
-
240: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{adder}(val, params = {})\nunless val.respond_to?(:to_ical)\nraise(NotImplementedError, \"Property value object does not support to_ical method!\")\nend\n\nif @properties.has_key?(\"\#{property}\")\n@properties[\"\#{property}\"] << val\nelse\n@properties[\"\#{property}\"] = [val]\nend\nend\n"</span>
|
|
277
|
-
241:
|
|
278
|
-
242: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">228</span>
|
|
279
|
-
243: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"add_#{property.downcase}"</span>, <span class="ruby-node">"#{adder}"</span>)
|
|
280
|
-
244: <span class="ruby-keyword kw">end</span>
|
|
281
|
-
245:
|
|
282
|
-
246: <span class="ruby-comment cmt"># Remove an item from this properties array</span>
|
|
283
|
-
247: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">remover</span>
|
|
284
|
-
248: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{remover}(a)\nif @properties.has_key?(\"\#{property}\")\n@properties[\"\#{property}\"].delete(a)\nend\nend\n"</span>
|
|
285
|
-
249:
|
|
286
|
-
250: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">241</span>
|
|
287
|
-
251: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"remove_#{property.downcase}"</span>, <span class="ruby-node">"#{remover}"</span>)
|
|
288
|
-
252: <span class="ruby-keyword kw">end</span>
|
|
289
|
-
253:
|
|
290
|
-
254: <span class="ruby-keyword kw">end</span>
|
|
291
|
-
</pre>
|
|
292
|
-
</div>
|
|
293
214
|
</div>
|
|
294
215
|
</div>
|
|
295
216
|
|
|
296
|
-
<div id="method-
|
|
297
|
-
<a name="
|
|
217
|
+
<div id="method-M000048" class="method-detail">
|
|
218
|
+
<a name="M000048"></a>
|
|
298
219
|
|
|
299
220
|
<div class="method-heading">
|
|
300
|
-
<a href="
|
|
221
|
+
<a href="Component.src/M000048.html" target="Code" class="method-signature"
|
|
222
|
+
onclick="popupCode('Component.src/M000048.html');return false;">
|
|
301
223
|
<span class="method-name">ical_property</span><span class="method-args">(property, alias_name = nil, prop_name = nil)</span>
|
|
302
224
|
</a>
|
|
303
225
|
</div>
|
|
@@ -306,60 +228,13 @@ values for the same property name.
|
|
|
306
228
|
<p>
|
|
307
229
|
Define a set of methods supporting a new property
|
|
308
230
|
</p>
|
|
309
|
-
<p><a class="source-toggle" href="#"
|
|
310
|
-
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
|
311
|
-
<div class="method-source-code" id="M000036-source">
|
|
312
|
-
<pre>
|
|
313
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 135</span>
|
|
314
|
-
135: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_property</span>(<span class="ruby-identifier">property</span>, <span class="ruby-identifier">alias_name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">prop_name</span> = <span class="ruby-keyword kw">nil</span>)
|
|
315
|
-
136:
|
|
316
|
-
137: <span class="ruby-identifier">property</span> = <span class="ruby-node">"#{property}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
|
317
|
-
138: <span class="ruby-identifier">getter</span> = <span class="ruby-node">"#{property}"</span>
|
|
318
|
-
139: <span class="ruby-identifier">setter</span> = <span class="ruby-node">"#{property}="</span>
|
|
319
|
-
140: <span class="ruby-identifier">query</span> = <span class="ruby-node">"#{property}?"</span>
|
|
320
|
-
141: <span class="ruby-identifier">alias_name</span> = <span class="ruby-node">"#{alias_name}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
|
|
321
|
-
142:
|
|
322
|
-
143: <span class="ruby-comment cmt"># If a prop_name was given then we use that for the actual storage</span>
|
|
323
|
-
144: <span class="ruby-identifier">property</span> = <span class="ruby-node">"#{prop_name}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">upcase</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">prop_name</span>.<span class="ruby-identifier">nil?</span>
|
|
324
|
-
145:
|
|
325
|
-
146: <span class="ruby-comment cmt"># Change underscores in property name to a dash</span>
|
|
326
|
-
147: <span class="ruby-identifier">property</span>[<span class="ruby-regexp re">/_/</span>] = <span class="ruby-value str">'-'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">property</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/_/</span>
|
|
327
|
-
148:
|
|
328
|
-
149: <span class="ruby-comment cmt"># All properties names are stored in caps...</span>
|
|
329
|
-
150: <span class="ruby-identifier">property</span> = <span class="ruby-identifier">property</span>.<span class="ruby-identifier">upcase</span>
|
|
330
|
-
151:
|
|
331
|
-
152: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">getter</span>
|
|
332
|
-
153: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{getter}(val = nil, params = {})\nif val.nil?\n@properties[\"\#{property}\"]\nelse\n# Set the value just like normal\nself.\#{setter}(val)\nend\nend\n"</span>
|
|
333
|
-
154:
|
|
334
|
-
155: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">155</span>
|
|
335
|
-
156: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"#{alias_name}"</span>, <span class="ruby-node">"#{getter}"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
|
|
336
|
-
157: <span class="ruby-keyword kw">end</span>
|
|
337
|
-
158:
|
|
338
|
-
159: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">setter</span>
|
|
339
|
-
160: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{setter}(val)\nunless val.respond_to?(:to_ical)\nraise(NotImplementedError, \"Value of type (\" + val.class.to_s + \") does not support to_ical method!\")\nend\n\n@properties[\"\#{property}\"] = val\nend\n"</span>
|
|
340
|
-
161:
|
|
341
|
-
162: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">171</span>
|
|
342
|
-
163:
|
|
343
|
-
164: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"#{alias_name}="</span>, <span class="ruby-node">"#{setter}"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
|
|
344
|
-
165: <span class="ruby-keyword kw">end</span>
|
|
345
|
-
166:
|
|
346
|
-
167: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">query</span>
|
|
347
|
-
168: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{query}\n@properties.has_key?(\"\#{property}\")\nend\n"</span>
|
|
348
|
-
169:
|
|
349
|
-
170: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">183</span>
|
|
350
|
-
171:
|
|
351
|
-
172: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"#{alias_name}\?"</span>, <span class="ruby-node">"#{query}"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
|
|
352
|
-
173: <span class="ruby-keyword kw">end</span>
|
|
353
|
-
174: <span class="ruby-keyword kw">end</span>
|
|
354
|
-
</pre>
|
|
355
|
-
</div>
|
|
356
231
|
</div>
|
|
357
232
|
</div>
|
|
358
233
|
|
|
359
234
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
360
235
|
|
|
361
|
-
<div id="method-
|
|
362
|
-
<a name="
|
|
236
|
+
<div id="method-M000031" class="method-detail">
|
|
237
|
+
<a name="M000031"></a>
|
|
363
238
|
|
|
364
239
|
<div class="method-heading">
|
|
365
240
|
<span class="method-name">add</span><span class="method-args">(component)</span>
|
|
@@ -367,16 +242,17 @@ Define a set of methods supporting a new property
|
|
|
367
242
|
|
|
368
243
|
<div class="method-description">
|
|
369
244
|
<p>
|
|
370
|
-
Alias for <a href="Component.html#
|
|
245
|
+
Alias for <a href="Component.html#M000030">add_component</a>
|
|
371
246
|
</p>
|
|
372
247
|
</div>
|
|
373
248
|
</div>
|
|
374
249
|
|
|
375
|
-
<div id="method-
|
|
376
|
-
<a name="
|
|
250
|
+
<div id="method-M000030" class="method-detail">
|
|
251
|
+
<a name="M000030"></a>
|
|
377
252
|
|
|
378
253
|
<div class="method-heading">
|
|
379
|
-
<a href="
|
|
254
|
+
<a href="Component.src/M000030.html" target="Code" class="method-signature"
|
|
255
|
+
onclick="popupCode('Component.src/M000030.html');return false;">
|
|
380
256
|
<span class="method-name">add_component</span><span class="method-args">(component)</span>
|
|
381
257
|
</a>
|
|
382
258
|
</div>
|
|
@@ -385,22 +261,34 @@ Alias for <a href="Component.html#M000027">add_component</a>
|
|
|
385
261
|
<p>
|
|
386
262
|
Add a sub-component to the current component object.
|
|
387
263
|
</p>
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
<
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
</
|
|
403
|
-
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
<div id="method-M000032" class="method-detail">
|
|
268
|
+
<a name="M000032"></a>
|
|
269
|
+
|
|
270
|
+
<div class="method-heading">
|
|
271
|
+
<span class="method-name">add_event</span><span class="method-args">(component)</span>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<div class="method-description">
|
|
275
|
+
<p>
|
|
276
|
+
Alias for <a href="Component.html#M000030">add_component</a>
|
|
277
|
+
</p>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<div id="method-M000034" class="method-detail">
|
|
282
|
+
<a name="M000034"></a>
|
|
283
|
+
|
|
284
|
+
<div class="method-heading">
|
|
285
|
+
<span class="method-name">add_journal</span><span class="method-args">(component)</span>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<div class="method-description">
|
|
289
|
+
<p>
|
|
290
|
+
Alias for <a href="Component.html#M000030">add_component</a>
|
|
291
|
+
</p>
|
|
404
292
|
</div>
|
|
405
293
|
</div>
|
|
406
294
|
|
|
@@ -408,57 +296,73 @@ Add a sub-component to the current component object.
|
|
|
408
296
|
<a name="M000033"></a>
|
|
409
297
|
|
|
410
298
|
<div class="method-heading">
|
|
411
|
-
<
|
|
299
|
+
<span class="method-name">add_todo</span><span class="method-args">(component)</span>
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<div class="method-description">
|
|
303
|
+
<p>
|
|
304
|
+
Alias for <a href="Component.html#M000030">add_component</a>
|
|
305
|
+
</p>
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<div id="method-M000045" class="method-detail">
|
|
310
|
+
<a name="M000045"></a>
|
|
311
|
+
|
|
312
|
+
<div class="method-heading">
|
|
313
|
+
<a href="Component.src/M000045.html" target="Code" class="method-signature"
|
|
314
|
+
onclick="popupCode('Component.src/M000045.html');return false;">
|
|
412
315
|
<span class="method-name">custom_property</span><span class="method-args">(name, value)</span>
|
|
413
316
|
</a>
|
|
414
317
|
</div>
|
|
415
318
|
|
|
416
319
|
<div class="method-description">
|
|
417
320
|
<p>
|
|
418
|
-
TODO: Look into the x-property, x-param stuff…
|
|
321
|
+
TODO: Look into the x-property, x-param stuff… This would really only
|
|
322
|
+
be needed for subclassing to add additional properties to an application
|
|
323
|
+
using the API.
|
|
419
324
|
</p>
|
|
420
|
-
<p><a class="source-toggle" href="#"
|
|
421
|
-
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
|
422
|
-
<div class="method-source-code" id="M000033-source">
|
|
423
|
-
<pre>
|
|
424
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 119</span>
|
|
425
|
-
119: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">custom_property</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>)
|
|
426
|
-
120: <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span>
|
|
427
|
-
121: <span class="ruby-keyword kw">end</span>
|
|
428
|
-
</pre>
|
|
429
|
-
</div>
|
|
430
325
|
</div>
|
|
431
326
|
</div>
|
|
432
327
|
|
|
433
|
-
<div id="method-
|
|
434
|
-
<a name="
|
|
328
|
+
<div id="method-M000046" class="method-detail">
|
|
329
|
+
<a name="M000046"></a>
|
|
435
330
|
|
|
436
331
|
<div class="method-heading">
|
|
437
|
-
<a href="
|
|
332
|
+
<a href="Component.src/M000046.html" target="Code" class="method-signature"
|
|
333
|
+
onclick="popupCode('Component.src/M000046.html');return false;">
|
|
438
334
|
<span class="method-name">multi_property?</span><span class="method-args">(name)</span>
|
|
439
335
|
</a>
|
|
440
336
|
</div>
|
|
441
337
|
|
|
442
338
|
<div class="method-description">
|
|
443
|
-
<p><a class="source-toggle" href="#"
|
|
444
|
-
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
|
445
|
-
<div class="method-source-code" id="M000034-source">
|
|
446
|
-
<pre>
|
|
447
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 123</span>
|
|
448
|
-
123: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">multi_property?</span>(<span class="ruby-identifier">name</span>)
|
|
449
|
-
124: <span class="ruby-ivar">@@multi_properties</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">upcase</span>)
|
|
450
|
-
125: <span class="ruby-keyword kw">end</span>
|
|
451
|
-
</pre>
|
|
452
|
-
</div>
|
|
453
339
|
</div>
|
|
454
340
|
</div>
|
|
455
341
|
|
|
456
|
-
<div id="method-
|
|
457
|
-
<a name="
|
|
342
|
+
<div id="method-M000040" class="method-detail">
|
|
343
|
+
<a name="M000040"></a>
|
|
344
|
+
|
|
345
|
+
<div class="method-heading">
|
|
346
|
+
<a href="Component.src/M000040.html" target="Code" class="method-signature"
|
|
347
|
+
onclick="popupCode('Component.src/M000040.html');return false;">
|
|
348
|
+
<span class="method-name">new_uid</span><span class="method-args">()</span>
|
|
349
|
+
</a>
|
|
350
|
+
</div>
|
|
351
|
+
|
|
352
|
+
<div class="method-description">
|
|
353
|
+
<p>
|
|
354
|
+
Used to generate unique component ids
|
|
355
|
+
</p>
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
<div id="method-M000042" class="method-detail">
|
|
360
|
+
<a name="M000042"></a>
|
|
458
361
|
|
|
459
362
|
<div class="method-heading">
|
|
460
|
-
<a href="
|
|
461
|
-
|
|
363
|
+
<a href="Component.src/M000042.html" target="Code" class="method-signature"
|
|
364
|
+
onclick="popupCode('Component.src/M000042.html');return false;">
|
|
365
|
+
<span class="method-name">print_component</span><span class="method-args">() {|+| ...}</span>
|
|
462
366
|
</a>
|
|
463
367
|
</div>
|
|
464
368
|
|
|
@@ -466,37 +370,16 @@ TODO: Look into the x-property, x-param stuff…
|
|
|
466
370
|
<p>
|
|
467
371
|
Print this icalendar component
|
|
468
372
|
</p>
|
|
469
|
-
<p><a class="source-toggle" href="#"
|
|
470
|
-
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
|
471
|
-
<div class="method-source-code" id="M000030-source">
|
|
472
|
-
<pre>
|
|
473
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 57</span>
|
|
474
|
-
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_component</span>
|
|
475
|
-
58: <span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
|
476
|
-
59:
|
|
477
|
-
60: <span class="ruby-comment cmt"># Begin a new component</span>
|
|
478
|
-
61: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"BEGIN:#{@name.upcase}\r\n"</span>
|
|
479
|
-
62:
|
|
480
|
-
63: <span class="ruby-comment cmt"># Then the properties</span>
|
|
481
|
-
64: <span class="ruby-identifier">print_properties</span>(<span class="ruby-identifier">s</span>)
|
|
482
|
-
65:
|
|
483
|
-
66: <span class="ruby-comment cmt"># Any custom body of the derived component</span>
|
|
484
|
-
67: <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">s</span>)
|
|
485
|
-
68:
|
|
486
|
-
69: <span class="ruby-comment cmt"># End of this component</span>
|
|
487
|
-
70: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"END:#{@name.upcase}\r\n"</span>
|
|
488
|
-
71: <span class="ruby-keyword kw">end</span>
|
|
489
|
-
</pre>
|
|
490
|
-
</div>
|
|
491
373
|
</div>
|
|
492
374
|
</div>
|
|
493
375
|
|
|
494
|
-
<div id="method-
|
|
495
|
-
<a name="
|
|
376
|
+
<div id="method-M000044" class="method-detail">
|
|
377
|
+
<a name="M000044"></a>
|
|
496
378
|
|
|
497
379
|
<div class="method-heading">
|
|
498
|
-
<a href="
|
|
499
|
-
|
|
380
|
+
<a href="Component.src/M000044.html" target="Code" class="method-signature"
|
|
381
|
+
onclick="popupCode('Component.src/M000044.html');return false;">
|
|
382
|
+
<span class="method-name">print_parameters</span><span class="method-args">(val)</span>
|
|
500
383
|
</a>
|
|
501
384
|
</div>
|
|
502
385
|
|
|
@@ -504,44 +387,16 @@ Print this icalendar component
|
|
|
504
387
|
<p>
|
|
505
388
|
Print the parameters for a specific property
|
|
506
389
|
</p>
|
|
507
|
-
<p><a class="source-toggle" href="#"
|
|
508
|
-
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
|
509
|
-
<div class="method-source-code" id="M000032-source">
|
|
510
|
-
<pre>
|
|
511
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 95</span>
|
|
512
|
-
95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_parameter</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
|
513
|
-
96: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@property_params</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">key</span>)
|
|
514
|
-
97: <span class="ruby-identifier">params</span> = <span class="ruby-ivar">@property_params</span>[<span class="ruby-identifier">key</span>]
|
|
515
|
-
98: <span class="ruby-identifier">params</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
|
516
|
-
99: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">";#{key}"</span>
|
|
517
|
-
100: <span class="ruby-identifier">val</span> = [ <span class="ruby-identifier">val</span> ] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_ary</span>)
|
|
518
|
-
101:
|
|
519
|
-
102: <span class="ruby-comment cmt"># Possible parameter values</span>
|
|
520
|
-
103: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">empty?</span>
|
|
521
|
-
104: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"="</span>
|
|
522
|
-
105: <span class="ruby-identifier">sep</span> = <span class="ruby-value str">""</span> <span class="ruby-comment cmt"># First entry comes after = sign, but then we need commas</span>
|
|
523
|
-
106: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pval</span><span class="ruby-operator">|</span>
|
|
524
|
-
107: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pval</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:to_ical</span>
|
|
525
|
-
108: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">sep</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">pval</span>.<span class="ruby-identifier">to_ical</span>
|
|
526
|
-
109: <span class="ruby-identifier">sep</span> = <span class="ruby-value str">","</span>
|
|
527
|
-
110: <span class="ruby-keyword kw">end</span>
|
|
528
|
-
111: <span class="ruby-keyword kw">end</span>
|
|
529
|
-
112: <span class="ruby-keyword kw">end</span>
|
|
530
|
-
113:
|
|
531
|
-
114: <span class="ruby-keyword kw">end</span>
|
|
532
|
-
115: <span class="ruby-keyword kw">end</span>
|
|
533
|
-
116: <span class="ruby-keyword kw">end</span>
|
|
534
|
-
</pre>
|
|
535
|
-
</div>
|
|
536
390
|
</div>
|
|
537
391
|
</div>
|
|
538
392
|
|
|
539
|
-
<div id="method-
|
|
540
|
-
<a name="
|
|
393
|
+
<div id="method-M000043" class="method-detail">
|
|
394
|
+
<a name="M000043"></a>
|
|
541
395
|
|
|
542
396
|
<div class="method-heading">
|
|
543
|
-
<a href="
|
|
544
|
-
|
|
397
|
+
<a href="Component.src/M000043.html" target="Code" class="method-signature"
|
|
398
|
+
onclick="popupCode('Component.src/M000043.html');return false;">
|
|
399
|
+
<span class="method-name">print_properties</span><span class="method-args">()</span>
|
|
545
400
|
</a>
|
|
546
401
|
</div>
|
|
547
402
|
|
|
@@ -549,129 +404,107 @@ Print the parameters for a specific property
|
|
|
549
404
|
<p>
|
|
550
405
|
Print this components properties
|
|
551
406
|
</p>
|
|
552
|
-
<p><a class="source-toggle" href="#"
|
|
553
|
-
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
|
554
|
-
<div class="method-source-code" id="M000031-source">
|
|
555
|
-
<pre>
|
|
556
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 74</span>
|
|
557
|
-
74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_properties</span>(<span class="ruby-identifier">s</span>)
|
|
558
|
-
75: <span class="ruby-ivar">@properties</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
|
559
|
-
76:
|
|
560
|
-
77: <span class="ruby-comment cmt"># Take out underscore for property names that conflicted</span>
|
|
561
|
-
78: <span class="ruby-comment cmt"># with built-in words.</span>
|
|
562
|
-
79: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/ip_.*/</span>
|
|
563
|
-
80: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>[<span class="ruby-value">3</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
564
|
-
81: <span class="ruby-keyword kw">end</span>
|
|
565
|
-
82:
|
|
566
|
-
83: <span class="ruby-comment cmt"># Property name</span>
|
|
567
|
-
84: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{key.upcase}"</span>
|
|
568
|
-
85:
|
|
569
|
-
86: <span class="ruby-comment cmt"># Possible parameters</span>
|
|
570
|
-
87: <span class="ruby-identifier">print_parameter</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
|
571
|
-
88:
|
|
572
|
-
89: <span class="ruby-comment cmt"># Property value</span>
|
|
573
|
-
90: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">":#{value.to_ical}\r\n"</span>
|
|
574
|
-
91: <span class="ruby-keyword kw">end</span>
|
|
575
|
-
92: <span class="ruby-keyword kw">end</span>
|
|
576
|
-
</pre>
|
|
577
|
-
</div>
|
|
578
407
|
</div>
|
|
579
408
|
</div>
|
|
580
409
|
|
|
581
|
-
<div id="method-
|
|
582
|
-
<a name="
|
|
410
|
+
<div id="method-M000036" class="method-detail">
|
|
411
|
+
<a name="M000036"></a>
|
|
583
412
|
|
|
584
413
|
<div class="method-heading">
|
|
585
|
-
<
|
|
586
|
-
<span class="method-name">respond_to?</span><span class="method-args">(method_name)</span>
|
|
587
|
-
</a>
|
|
414
|
+
<span class="method-name">remove</span><span class="method-args">(component)</span>
|
|
588
415
|
</div>
|
|
589
416
|
|
|
590
417
|
<div class="method-description">
|
|
591
|
-
<p
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
<pre>
|
|
595
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 334</span>
|
|
596
|
-
334: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_name</span>)
|
|
597
|
-
335: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/x-.*/</span>
|
|
598
|
-
336: <span class="ruby-keyword kw">super</span>
|
|
599
|
-
337: <span class="ruby-keyword kw">end</span>
|
|
600
|
-
338:
|
|
601
|
-
339: <span class="ruby-keyword kw">true</span>
|
|
602
|
-
340: <span class="ruby-keyword kw">end</span>
|
|
603
|
-
</pre>
|
|
604
|
-
</div>
|
|
418
|
+
<p>
|
|
419
|
+
Alias for <a href="Component.html#M000035">remove_component</a>
|
|
420
|
+
</p>
|
|
605
421
|
</div>
|
|
606
422
|
</div>
|
|
607
423
|
|
|
608
|
-
<div id="method-
|
|
609
|
-
<a name="
|
|
424
|
+
<div id="method-M000035" class="method-detail">
|
|
425
|
+
<a name="M000035"></a>
|
|
610
426
|
|
|
611
427
|
<div class="method-heading">
|
|
612
|
-
<a href="
|
|
613
|
-
|
|
428
|
+
<a href="Component.src/M000035.html" target="Code" class="method-signature"
|
|
429
|
+
onclick="popupCode('Component.src/M000035.html');return false;">
|
|
430
|
+
<span class="method-name">remove_component</span><span class="method-args">(component)</span>
|
|
614
431
|
</a>
|
|
615
432
|
</div>
|
|
616
433
|
|
|
617
434
|
<div class="method-description">
|
|
618
|
-
<p><a class="source-toggle" href="#"
|
|
619
|
-
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
|
620
|
-
<div class="method-source-code" id="M000029-source">
|
|
621
|
-
<pre>
|
|
622
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 48</span>
|
|
623
|
-
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
|
|
624
|
-
49: <span class="ruby-identifier">print_component</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
|
625
|
-
50: <span class="ruby-ivar">@components</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">comps</span><span class="ruby-operator">|</span>
|
|
626
|
-
51: <span class="ruby-identifier">comps</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">component</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">component</span>.<span class="ruby-identifier">to_ical</span> }
|
|
627
|
-
52: <span class="ruby-keyword kw">end</span>
|
|
628
|
-
53: <span class="ruby-keyword kw">end</span>
|
|
629
|
-
54: <span class="ruby-keyword kw">end</span>
|
|
630
|
-
</pre>
|
|
631
|
-
</div>
|
|
632
435
|
</div>
|
|
633
436
|
</div>
|
|
634
437
|
|
|
635
|
-
<
|
|
438
|
+
<div id="method-M000037" class="method-detail">
|
|
439
|
+
<a name="M000037"></a>
|
|
440
|
+
|
|
441
|
+
<div class="method-heading">
|
|
442
|
+
<span class="method-name">remove_event</span><span class="method-args">(component)</span>
|
|
443
|
+
</div>
|
|
444
|
+
|
|
445
|
+
<div class="method-description">
|
|
446
|
+
<p>
|
|
447
|
+
Alias for <a href="Component.html#M000035">remove_component</a>
|
|
448
|
+
</p>
|
|
449
|
+
</div>
|
|
450
|
+
</div>
|
|
451
|
+
|
|
452
|
+
<div id="method-M000039" class="method-detail">
|
|
453
|
+
<a name="M000039"></a>
|
|
454
|
+
|
|
455
|
+
<div class="method-heading">
|
|
456
|
+
<span class="method-name">remove_journal</span><span class="method-args">(component)</span>
|
|
457
|
+
</div>
|
|
458
|
+
|
|
459
|
+
<div class="method-description">
|
|
460
|
+
<p>
|
|
461
|
+
Alias for <a href="Component.html#M000035">remove_component</a>
|
|
462
|
+
</p>
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
636
465
|
|
|
637
466
|
<div id="method-M000038" class="method-detail">
|
|
638
467
|
<a name="M000038"></a>
|
|
639
468
|
|
|
640
469
|
<div class="method-heading">
|
|
641
|
-
<
|
|
642
|
-
|
|
470
|
+
<span class="method-name">remove_todo</span><span class="method-args">(component)</span>
|
|
471
|
+
</div>
|
|
472
|
+
|
|
473
|
+
<div class="method-description">
|
|
474
|
+
<p>
|
|
475
|
+
Alias for <a href="Component.html#M000035">remove_component</a>
|
|
476
|
+
</p>
|
|
477
|
+
</div>
|
|
478
|
+
</div>
|
|
479
|
+
|
|
480
|
+
<div id="method-M000050" class="method-detail">
|
|
481
|
+
<a name="M000050"></a>
|
|
482
|
+
|
|
483
|
+
<div class="method-heading">
|
|
484
|
+
<a href="Component.src/M000050.html" target="Code" class="method-signature"
|
|
485
|
+
onclick="popupCode('Component.src/M000050.html');return false;">
|
|
486
|
+
<span class="method-name">respond_to?</span><span class="method-args">(method_name)</span>
|
|
487
|
+
</a>
|
|
488
|
+
</div>
|
|
489
|
+
|
|
490
|
+
<div class="method-description">
|
|
491
|
+
</div>
|
|
492
|
+
</div>
|
|
493
|
+
|
|
494
|
+
<div id="method-M000041" class="method-detail">
|
|
495
|
+
<a name="M000041"></a>
|
|
496
|
+
|
|
497
|
+
<div class="method-heading">
|
|
498
|
+
<a href="Component.src/M000041.html" target="Code" class="method-signature"
|
|
499
|
+
onclick="popupCode('Component.src/M000041.html');return false;">
|
|
500
|
+
<span class="method-name">to_ical</span><span class="method-args">()</span>
|
|
643
501
|
</a>
|
|
644
502
|
</div>
|
|
645
503
|
|
|
646
504
|
<div class="method-description">
|
|
647
|
-
<p
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
<pre>
|
|
651
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 310</span>
|
|
652
|
-
310: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
653
|
-
311: <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
|
|
654
|
-
312:
|
|
655
|
-
313: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/x_.*/</span>
|
|
656
|
-
314: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>
|
|
657
|
-
315: <span class="ruby-keyword kw">end</span>
|
|
658
|
-
316:
|
|
659
|
-
317: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>
|
|
660
|
-
318:
|
|
661
|
-
319: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_ical</span>)
|
|
662
|
-
320: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">NotImplementedError</span>, <span class="ruby-value str">"Value of type ("</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">") does not support to_ical method!"</span>)
|
|
663
|
-
321: <span class="ruby-keyword kw">end</span>
|
|
664
|
-
322:
|
|
665
|
-
323: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.*)(=)/</span> <span class="ruby-comment cmt"># Its a setter</span>
|
|
666
|
-
324: <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">$1</span>] = <span class="ruby-identifier">val</span>
|
|
667
|
-
325: <span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Setting #{$1} => #{val}"</span>)
|
|
668
|
-
326: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># Or its a getter</span>
|
|
669
|
-
327: <span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Getting #{method_name} => #{@properties[method_name]}"</span>)
|
|
670
|
-
328: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">method_name</span>]
|
|
671
|
-
329: <span class="ruby-keyword kw">end</span>
|
|
672
|
-
330: <span class="ruby-keyword kw">end</span>
|
|
673
|
-
</pre>
|
|
674
|
-
</div>
|
|
505
|
+
<p>
|
|
506
|
+
Output in the icalendar format
|
|
507
|
+
</p>
|
|
675
508
|
</div>
|
|
676
509
|
</div>
|
|
677
510
|
|