html/classes/GoogleCalendar/Event.html in gcalapi-0.1.1 vs html/classes/GoogleCalendar/Event.html in gcalapi-0.1.2

- old
+ new

@@ -1,502 +1,502 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Class: GoogleCalendar::Event</title> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> - <meta http-equiv="Content-Script-Type" content="text/javascript" /> - <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> - <script type="text/javascript"> - // <![CDATA[ - - function popupCode( url ) { - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") - } - - function toggleCode( id ) { - if ( document.getElementById ) - elem = document.getElementById( id ); - else if ( document.all ) - elem = eval( "document.all." + id ); - else - return false; - - elemStyle = elem.style; - - if ( elemStyle.display != "block" ) { - elemStyle.display = "block" - } else { - elemStyle.display = "none" - } - - return true; - } - - // Make codeblocks hidden by default - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) - - // ]]> - </script> - -</head> -<body> - - - - <div id="classHeader"> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Class</strong></td> - <td class="class-name-in-header">GoogleCalendar::Event</td> - </tr> - <tr class="top-aligned-row"> - <td><strong>In:</strong></td> - <td> - <a href="../../files/lib/googlecalendar/event_rb.html"> - lib/googlecalendar/event.rb - </a> - <br /> - </td> - </tr> - - <tr class="top-aligned-row"> - <td><strong>Parent:</strong></td> - <td> - Object - </td> - </tr> - </table> - </div> - <!-- banner header --> - - <div id="bodyContent"> - - - - <div id="contextContent"> - - <div id="description"> - <h1>Summary</h1> -<pre> - this class represents an event of a calendar. -</pre> -<h1>How to use this class</h1> -<ul> -<li>MAIL: your gmail account. - -</li> -<li>PASS: password for MAIL. - -</li> -<li>FEED: a calendar&#8216;s editable feed url. - -<ol> -<li>your default calendar&#8216;s feed url is defined in -Calendar::DEFAULT_CALENDAR_FEED. To <a href="Event.html#M000017">get</a> -other calendar&#8216;s feed url, read below. - -</li> -<li>click &quot;Manage Calendars&quot; in Google <a -href="Calendar.html">Calendar</a>. - -</li> -<li>select a calendar you want to edit. - -</li> -<li>copy private address of XML. - -</li> -<li>change the address&#8216;s end into &quot;/private/full&quot;. If your -calendar&#8216;s private XML address is - -<pre> - &quot;http://www.google.com/calendar/feeds/XXX@group.calendar.google.com/private-aaaaaa/basic&quot;, -</pre> -<p> -the editable feed url is -</p> -<pre> - &quot;http://www.google.com/calendar/feeds/XXX@group.calendar.google.com/private/full&quot;. -</pre> -</li> -<li>for detail, See <a -href="http://code.google.com/apis/gdata/calendar.html#Visibility">code.google.com/apis/gdata/calendar.html#Visibility</a>. - -</li> -</ol> -</li> -</ul> -<h2>create <a href="Event.html#M000010">new</a> events</h2> -<pre> - cal = Calendar.new(Service.new(MAIL, PASS), FEED) - event = cal.create_event - event.title = &quot;event title&quot; - event.desc = &quot;event description&quot; - event.where = &quot;event location&quot; - event.st = Time.mktime(2006, 9, 21, 01, 0, 0) - event.en = Time.mktime(2006, 9, 21, 03, 0, 0) - event.save! -</pre> -<h2>udpate existing events</h2> -<pre> - cal = Calendar.new(Service.new(MAIL, PASS), FEED) - event = cal.events[0] - event.title = &quot;event title&quot; - event.desc = &quot;event description&quot; - event.where = &quot;event location&quot; - event.st = Time.mktime(2006, 9, 21, 01, 0, 0) - event.en = Time.mktime(2006, 9, 21, 03, 0, 0) - event.save! -</pre> -<h2>delete events</h2> -<pre> - cal = Calendar.new(Service.new(MAIL, PASS), FEED) - event = cal.events[0] - event.destroy! -</pre> -<h2>create all day events.</h2> -<pre> - event = cal.create_event - event.title = &quot;1 days event&quot; - event.st = Time.mktime(2006, 9, 22) - event.en = Time.mktime(2006, 9, 23) - event.allday = true - event.save! - - event = cal.create_event - event.title = &quot;2 days event&quot; - event.st = Time.mktime(2006, 9, 22) - event.en = Time.mktime(2006, 9, 24) - event.allday = true - event.save! -</pre> -<h2><a href="Event.html#M000017">get</a> existint event</h2> -<pre> - event = Event.get(FEED, Service.new(MAIL, PASS)) -</pre> -<h1>TODO</h1> -<ul> -<li>this class doesn&#8216;t support recurring event. - -</li> -</ul> - - </div> - - - </div> - - <div id="method-list"> - <h3 class="section-bar">Methods</h3> - - <div class="name-list"> - <a href="#M000014">destroy</a>&nbsp;&nbsp; - <a href="#M000015">destroy!</a>&nbsp;&nbsp; - <a href="#M000018">do_without_exception</a>&nbsp;&nbsp; - <a href="#M000017">get</a>&nbsp;&nbsp; - <a href="#M000020">instance_to_xml</a>&nbsp;&nbsp; - <a href="#M000011">load_xml</a>&nbsp;&nbsp; - <a href="#M000010">new</a>&nbsp;&nbsp; - <a href="#M000012">save</a>&nbsp;&nbsp; - <a href="#M000013">save!</a>&nbsp;&nbsp; - <a href="#M000021">str_to_time</a>&nbsp;&nbsp; - <a href="#M000022">time_to_str</a>&nbsp;&nbsp; - <a href="#M000016">to_s</a>&nbsp;&nbsp; - <a href="#M000019">xml_to_instance</a>&nbsp;&nbsp; - </div> - </div> - - </div> - - - <!-- if includes --> - - <div id="section"> - - - <div id="constants-list"> - <h3 class="section-bar">Constants</h3> - - <div class="name-list"> - <table summary="Constants"> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">ATTRIBUTES_MAP</td> - <td>=</td> - <td class="context-item-value">{ &quot;title&quot; =&gt; { &quot;element&quot; =&gt; &quot;title&quot;}, &quot;desc&quot; =&gt; { &quot;element&quot; =&gt; &quot;content&quot;}, &quot;where&quot; =&gt; { &quot;element&quot; =&gt; &quot;gd:where&quot;, &quot;attribute&quot; =&gt; &quot;valueString&quot; }, &quot;st&quot; =&gt; { &quot;element&quot; =&gt; &quot;gd:when&quot;, &quot;attribute&quot; =&gt; &quot;startTime&quot;, &quot;to_xml&quot; =&gt; &quot;time_to_str&quot;, &quot;from_xml&quot; =&gt; &quot;str_to_time&quot; }, &quot;en&quot; =&gt; { &quot;element&quot; =&gt; &quot;gd:when&quot;, &quot;attribute&quot; =&gt; &quot;endTime&quot;, &quot;to_xml&quot; =&gt; &quot;time_to_str&quot;, &quot;from_xml&quot; =&gt; &quot;str_to_time&quot; }</td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">SKELTON</td> - <td>=</td> - <td class="context-item-value">&lt;&lt;XML &lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'&gt; &lt;category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'&gt;&lt;/category&gt; &lt;title type='text'&gt;&lt;/title&gt; &lt;content type='text'&gt;&lt;/content&gt; &lt;gd:transparency value='http://schemas.google.com/g/2005#event.opaque'&gt;&lt;/gd:transparency&gt; &lt;gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'&gt;&lt;/gd:eventStatus&gt; &lt;/entry&gt; XML</td> - </tr> - </table> - </div> - </div> - - - - <div id="attribute-list"> - <h3 class="section-bar">Attributes</h3> - - <div class="name-list"> - <table> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">allday</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">desc</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">en</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">feed</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">srv</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">st</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">status</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">title</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">where</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">xml</td> - <td class="context-item-value">&nbsp;[RW]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - </table> - </div> - </div> - - - - <!-- if method_list --> - <div id="methods"> - <h3 class="section-bar">Public Class methods</h3> - - <div id="method-M000017" class="method-detail"> - <a name="M000017"></a> - - <div class="method-heading"> - <a href="#M000017" class="method-signature"> - <span class="method-name">get</span><span class="method-args">(feed, srv)</span> - </a> - </div> - - <div class="method-description"> - <p> -<a href="Event.html#M000017">get</a> event from event feed -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000017-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000017-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 168</span> +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Class: GoogleCalendar::Event</title> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> + <meta http-equiv="Content-Script-Type" content="text/javascript" /> + <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> + <script type="text/javascript"> + // <![CDATA[ + + function popupCode( url ) { + window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") + } + + function toggleCode( id ) { + if ( document.getElementById ) + elem = document.getElementById( id ); + else if ( document.all ) + elem = eval( "document.all." + id ); + else + return false; + + elemStyle = elem.style; + + if ( elemStyle.display != "block" ) { + elemStyle.display = "block" + } else { + elemStyle.display = "none" + } + + return true; + } + + // Make codeblocks hidden by default + document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) + + // ]]> + </script> + +</head> +<body> + + + + <div id="classHeader"> + <table class="header-table"> + <tr class="top-aligned-row"> + <td><strong>Class</strong></td> + <td class="class-name-in-header">GoogleCalendar::Event</td> + </tr> + <tr class="top-aligned-row"> + <td><strong>In:</strong></td> + <td> + <a href="../../files/lib/googlecalendar/event_rb.html"> + lib/googlecalendar/event.rb + </a> + <br /> + </td> + </tr> + + <tr class="top-aligned-row"> + <td><strong>Parent:</strong></td> + <td> + Object + </td> + </tr> + </table> + </div> + <!-- banner header --> + + <div id="bodyContent"> + + + + <div id="contextContent"> + + <div id="description"> + <h1>Summary</h1> +<pre> + this class represents an event of a calendar. +</pre> +<h1>How to use this class</h1> +<ul> +<li>MAIL: your gmail account. + +</li> +<li>PASS: password for MAIL. + +</li> +<li>FEED: a calendar&#8216;s editable feed url. + +<ol> +<li>your default calendar&#8216;s feed url is defined in +Calendar::DEFAULT_CALENDAR_FEED. To <a href="Event.html#M000023">get</a> +other calendar&#8216;s feed url, read below. + +</li> +<li>click &quot;Manage Calendars&quot; in Google <a +href="Calendar.html">Calendar</a>. + +</li> +<li>select a calendar you want to edit. + +</li> +<li>copy private address of XML. + +</li> +<li>change the address&#8216;s end into &quot;/private/full&quot;. If your +calendar&#8216;s private XML address is + +<pre> + &quot;http://www.google.com/calendar/feeds/XXX@group.calendar.google.com/private-aaaaaa/basic&quot;, +</pre> +<p> +the editable feed url is +</p> +<pre> + &quot;http://www.google.com/calendar/feeds/XXX@group.calendar.google.com/private/full&quot;. +</pre> +</li> +<li>for detail, See <a +href="http://code.google.com/apis/gdata/calendar.html#Visibility">code.google.com/apis/gdata/calendar.html#Visibility</a>. + +</li> +</ol> +</li> +</ul> +<h2>create <a href="Event.html#M000016">new</a> events</h2> +<pre> + cal = Calendar.new(Service.new(MAIL, PASS), FEED) + event = cal.create_event + event.title = &quot;event title&quot; + event.desc = &quot;event description&quot; + event.where = &quot;event location&quot; + event.st = Time.mktime(2006, 9, 21, 01, 0, 0) + event.en = Time.mktime(2006, 9, 21, 03, 0, 0) + event.save! +</pre> +<h2>udpate existing events</h2> +<pre> + cal = Calendar.new(Service.new(MAIL, PASS), FEED) + event = cal.events[0] + event.title = &quot;event title&quot; + event.desc = &quot;event description&quot; + event.where = &quot;event location&quot; + event.st = Time.mktime(2006, 9, 21, 01, 0, 0) + event.en = Time.mktime(2006, 9, 21, 03, 0, 0) + event.save! +</pre> +<h2>delete events</h2> +<pre> + cal = Calendar.new(Service.new(MAIL, PASS), FEED) + event = cal.events[0] + event.destroy! +</pre> +<h2>create all day events.</h2> +<pre> + event = cal.create_event + event.title = &quot;1 days event&quot; + event.st = Time.mktime(2006, 9, 22) + event.en = Time.mktime(2006, 9, 23) + event.allday = true + event.save! + + event = cal.create_event + event.title = &quot;2 days event&quot; + event.st = Time.mktime(2006, 9, 22) + event.en = Time.mktime(2006, 9, 24) + event.allday = true + event.save! +</pre> +<h2><a href="Event.html#M000023">get</a> existint event</h2> +<pre> + event = Event.get(FEED, Service.new(MAIL, PASS)) +</pre> +<h1>TODO</h1> +<ul> +<li>this class doesn&#8216;t support recurring event. + +</li> +</ul> + + </div> + + + </div> + + <div id="method-list"> + <h3 class="section-bar">Methods</h3> + + <div class="name-list"> + <a href="#M000020">destroy</a>&nbsp;&nbsp; + <a href="#M000021">destroy!</a>&nbsp;&nbsp; + <a href="#M000024">do_without_exception</a>&nbsp;&nbsp; + <a href="#M000023">get</a>&nbsp;&nbsp; + <a href="#M000026">instance_to_xml</a>&nbsp;&nbsp; + <a href="#M000017">load_xml</a>&nbsp;&nbsp; + <a href="#M000016">new</a>&nbsp;&nbsp; + <a href="#M000018">save</a>&nbsp;&nbsp; + <a href="#M000019">save!</a>&nbsp;&nbsp; + <a href="#M000027">str_to_time</a>&nbsp;&nbsp; + <a href="#M000028">time_to_str</a>&nbsp;&nbsp; + <a href="#M000022">to_s</a>&nbsp;&nbsp; + <a href="#M000025">xml_to_instance</a>&nbsp;&nbsp; + </div> + </div> + + </div> + + + <!-- if includes --> + + <div id="section"> + + + <div id="constants-list"> + <h3 class="section-bar">Constants</h3> + + <div class="name-list"> + <table summary="Constants"> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">ATTRIBUTES_MAP</td> + <td>=</td> + <td class="context-item-value">{ &quot;title&quot; =&gt; { &quot;element&quot; =&gt; &quot;title&quot;}, &quot;desc&quot; =&gt; { &quot;element&quot; =&gt; &quot;content&quot;}, &quot;where&quot; =&gt; { &quot;element&quot; =&gt; &quot;gd:where&quot;, &quot;attribute&quot; =&gt; &quot;valueString&quot; }, &quot;st&quot; =&gt; { &quot;element&quot; =&gt; &quot;gd:when&quot;, &quot;attribute&quot; =&gt; &quot;startTime&quot;, &quot;to_xml&quot; =&gt; &quot;time_to_str&quot;, &quot;from_xml&quot; =&gt; &quot;str_to_time&quot; }, &quot;en&quot; =&gt; { &quot;element&quot; =&gt; &quot;gd:when&quot;, &quot;attribute&quot; =&gt; &quot;endTime&quot;, &quot;to_xml&quot; =&gt; &quot;time_to_str&quot;, &quot;from_xml&quot; =&gt; &quot;str_to_time&quot; }</td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">SKELTON</td> + <td>=</td> + <td class="context-item-value">&lt;&lt;XML &lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'&gt; &lt;category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'&gt;&lt;/category&gt; &lt;title type='text'&gt;&lt;/title&gt; &lt;content type='text'&gt;&lt;/content&gt; &lt;gd:transparency value='http://schemas.google.com/g/2005#event.opaque'&gt;&lt;/gd:transparency&gt; &lt;gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'&gt;&lt;/gd:eventStatus&gt; &lt;/entry&gt; XML</td> + </tr> + </table> + </div> + </div> + + + + <div id="attribute-list"> + <h3 class="section-bar">Attributes</h3> + + <div class="name-list"> + <table> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">allday</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">desc</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">en</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">feed</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">srv</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">st</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">status</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">title</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">where</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + <tr class="top-aligned-row context-row"> + <td class="context-item-name">xml</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> + <td class="context-item-desc"></td> + </tr> + </table> + </div> + </div> + + + + <!-- if method_list --> + <div id="methods"> + <h3 class="section-bar">Public Class methods</h3> + + <div id="method-M000023" class="method-detail"> + <a name="M000023"></a> + + <div class="method-heading"> + <a href="#M000023" class="method-signature"> + <span class="method-name">get</span><span class="method-args">(feed, srv)</span> + </a> + </div> + + <div class="method-description"> + <p> +<a href="Event.html#M000023">get</a> event from event feed +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000023-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000023-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 168</span> 168: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">feed</span>, <span class="ruby-identifier">srv</span>) 169: <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">srv</span>.<span class="ruby-identifier">query</span>(<span class="ruby-identifier">feed</span>) 170: <span class="ruby-identifier">raise</span> <span class="ruby-constant">EventGetFailed</span>, <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">body</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">code</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;200&quot;</span> 171: <span class="ruby-identifier">evt</span> = <span class="ruby-constant">Event</span>.<span class="ruby-identifier">new</span> 172: <span class="ruby-identifier">evt</span>.<span class="ruby-identifier">srv</span> = <span class="ruby-identifier">srv</span> 173: <span class="ruby-identifier">evt</span>.<span class="ruby-identifier">load_xml</span>(<span class="ruby-identifier">ret</span>.<span class="ruby-identifier">body</span>) 174: <span class="ruby-identifier">evt</span> -175: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000010" class="method-detail"> - <a name="M000010"></a> - - <div class="method-heading"> - <a href="#M000010" class="method-signature"> - <span class="method-name">new</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000010-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000010-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 108</span> +175: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000016" class="method-detail"> + <a name="M000016"></a> + + <div class="method-heading"> + <a href="#M000016" class="method-signature"> + <span class="method-name">new</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000016-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000016-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 108</span> 108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>() 109: <span class="ruby-ivar">@xml</span> = <span class="ruby-keyword kw">nil</span> 110: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> = <span class="ruby-identifier">:new</span> -111: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <h3 class="section-bar">Public Instance methods</h3> - - <div id="method-M000014" class="method-detail"> - <a name="M000014"></a> - - <div class="method-heading"> - <a href="#M000014" class="method-signature"> - <span class="method-name">destroy</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> -same as <a href="Event.html#M000015">destroy!</a> If failed, this method -returns false. -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000014-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000014-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 144</span> +111: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <h3 class="section-bar">Public Instance methods</h3> + + <div id="method-M000020" class="method-detail"> + <a name="M000020"></a> + + <div class="method-heading"> + <a href="#M000020" class="method-signature"> + <span class="method-name">destroy</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p> +same as <a href="Event.html#M000021">destroy!</a> If failed, this method +returns false. +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000020-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000020-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 144</span> 144: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">destroy</span> 145: <span class="ruby-identifier">do_without_exception</span>(<span class="ruby-identifier">:destroy!</span>) -146: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000015" class="method-detail"> - <a name="M000015"></a> - - <div class="method-heading"> - <a href="#M000015" class="method-signature"> - <span class="method-name">destroy!</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> -delete this event from google calendar server. If failed, this method -throws an Exception. -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000015-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000015-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 149</span> +146: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000021" class="method-detail"> + <a name="M000021"></a> + + <div class="method-heading"> + <a href="#M000021" class="method-signature"> + <span class="method-name">destroy!</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p> +delete this event from google calendar server. If failed, this method +throws an Exception. +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000021-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000021-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 149</span> 149: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">destroy!</span> 150: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">nil</span> 151: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:old</span> 152: <span class="ruby-identifier">ret</span> = <span class="ruby-ivar">@srv</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">feed</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>) 153: <span class="ruby-identifier">raise</span> <span class="ruby-constant">EventDeleteFailed</span>, <span class="ruby-value str">&quot;Not Deleted&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">code</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;200&quot;</span> 154: <span class="ruby-keyword kw">else</span> 155: <span class="ruby-identifier">raise</span> <span class="ruby-constant">EventDeleteFailed</span>, <span class="ruby-value str">&quot;Not Saved&quot;</span> 156: <span class="ruby-keyword kw">end</span> 157: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">:deleted</span> -158: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000011" class="method-detail"> - <a name="M000011"></a> - - <div class="method-heading"> - <a href="#M000011" class="method-signature"> - <span class="method-name">load_xml</span><span class="method-args">(str)</span> - </a> - </div> - - <div class="method-description"> - <p> -load xml into this instance -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000011-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000011-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 114</span> +158: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000017" class="method-detail"> + <a name="M000017"></a> + + <div class="method-heading"> + <a href="#M000017" class="method-signature"> + <span class="method-name">load_xml</span><span class="method-args">(str)</span> + </a> + </div> + + <div class="method-description"> + <p> +load xml into this instance +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000017-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000017-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 114</span> 114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_xml</span>(<span class="ruby-identifier">str</span>) 115: <span class="ruby-ivar">@xml</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_s</span>) 116: <span class="ruby-identifier">xml_to_instance</span> 117: <span class="ruby-keyword kw">self</span> -118: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000012" class="method-detail"> - <a name="M000012"></a> - - <div class="method-heading"> - <a href="#M000012" class="method-signature"> - <span class="method-name">save</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> -same as <a href="Event.html#M000013">save!</a> If failed, this method -returns false. -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000012-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000012-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 121</span> +118: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000018" class="method-detail"> + <a name="M000018"></a> + + <div class="method-heading"> + <a href="#M000018" class="method-signature"> + <span class="method-name">save</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p> +same as <a href="Event.html#M000019">save!</a> If failed, this method +returns false. +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000018-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000018-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 121</span> 121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span> 122: <span class="ruby-identifier">do_without_exception</span>(<span class="ruby-identifier">:save!</span>) -123: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000013" class="method-detail"> - <a name="M000013"></a> - - <div class="method-heading"> - <a href="#M000013" class="method-signature"> - <span class="method-name">save!</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> -<a href="Event.html#M000012">save</a> this event into google calendar -server. If failed, this method throws an Exception. -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000013-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000013-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 126</span> +123: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000019" class="method-detail"> + <a name="M000019"></a> + + <div class="method-heading"> + <a href="#M000019" class="method-signature"> + <span class="method-name">save!</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p> +<a href="Event.html#M000018">save</a> this event into google calendar +server. If failed, this method throws an Exception. +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000019-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000019-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 126</span> 126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save!</span> 127: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">nil</span> 128: <span class="ruby-keyword kw">case</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> 129: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:new</span> 130: <span class="ruby-identifier">ret</span> = <span class="ruby-ivar">@srv</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">feed</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>) @@ -508,93 +508,93 @@ 136: <span class="ruby-identifier">raise</span> <span class="ruby-constant">EventDeleteFailed</span>, <span class="ruby-value str">&quot;already deleted&quot;</span> 137: <span class="ruby-keyword kw">else</span> 138: <span class="ruby-identifier">raise</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-value str">&quot;invalid inner status&quot;</span> 139: <span class="ruby-keyword kw">end</span> 140: <span class="ruby-identifier">load_xml</span>(<span class="ruby-identifier">ret</span>.<span class="ruby-identifier">body</span>) -141: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000016" class="method-detail"> - <a name="M000016"></a> - - <div class="method-heading"> - <a href="#M000016" class="method-signature"> - <span class="method-name">to_s</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> -retuns this event&#8216;s xml. -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000016-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000016-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 161</span> +141: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000022" class="method-detail"> + <a name="M000022"></a> + + <div class="method-heading"> + <a href="#M000022" class="method-signature"> + <span class="method-name">to_s</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p> +retuns this event&#8216;s xml. +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000022-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000022-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 161</span> 161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span> 162: <span class="ruby-ivar">@xml</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">SKELTON</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:new</span> 163: <span class="ruby-identifier">instance_to_xml</span> 164: <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">to_s</span> -165: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <h3 class="section-bar">Private Instance methods</h3> - - <div id="method-M000018" class="method-detail"> - <a name="M000018"></a> - - <div class="method-heading"> - <a href="#M000018" class="method-signature"> - <span class="method-name">do_without_exception</span><span class="method-args">(method)</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000018-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000018-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 178</span> +165: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <h3 class="section-bar">Private Instance methods</h3> + + <div id="method-M000024" class="method-detail"> + <a name="M000024"></a> + + <div class="method-heading"> + <a href="#M000024" class="method-signature"> + <span class="method-name">do_without_exception</span><span class="method-args">(method)</span> + </a> + </div> + + <div class="method-description"> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000024-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000024-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 178</span> 178: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_without_exception</span>(<span class="ruby-identifier">method</span>) 179: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">true</span> 180: <span class="ruby-keyword kw">begin</span> 181: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">method</span>) 182: <span class="ruby-keyword kw">rescue</span> 183: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">false</span> 184: <span class="ruby-keyword kw">end</span> 185: <span class="ruby-identifier">ret</span> -186: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000020" class="method-detail"> - <a name="M000020"></a> - - <div class="method-heading"> - <a href="#M000020" class="method-signature"> - <span class="method-name">instance_to_xml</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> -set attributes of an instance into xml -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000020-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000020-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 206</span> +186: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000026" class="method-detail"> + <a name="M000026"></a> + + <div class="method-heading"> + <a href="#M000026" class="method-signature"> + <span class="method-name">instance_to_xml</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p> +set attributes of an instance into xml +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000026-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000026-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 206</span> 206: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_to_xml</span> 207: <span class="ruby-constant">ATTRIBUTES_MAP</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">hash</span><span class="ruby-operator">|</span> 208: <span class="ruby-identifier">elem</span> = <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-identifier">hash</span>[<span class="ruby-value str">&quot;element&quot;</span>]] 209: <span class="ruby-identifier">elem</span> = <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-value str">&quot;element&quot;</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">nil?</span> 210: <span class="ruby-identifier">val</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">name</span>) @@ -603,171 +603,171 @@ 213: <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-identifier">hash</span>[<span class="ruby-value str">&quot;attribute&quot;</span>]] = <span class="ruby-identifier">val</span> 214: <span class="ruby-keyword kw">else</span> 215: <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">text</span> = <span class="ruby-identifier">val</span> 216: <span class="ruby-keyword kw">end</span> 217: <span class="ruby-keyword kw">end</span> -218: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000021" class="method-detail"> - <a name="M000021"></a> - - <div class="method-heading"> - <a href="#M000021" class="method-signature"> - <span class="method-name">str_to_time</span><span class="method-args">(st)</span> - </a> - </div> - - <div class="method-description"> - <h2>Allday <a href="Event.html">Event</a> Bugs</h2> -<p> -When creating all day event, the format of gd:when startTime and gd:when -endTime must be &quot;yyyy-mm-ddZ&quot; which represents UTC. otherwise the -wrong data returns. below is the test result. I used 3 countries&#8217; -calendar. US, UK, and Japan. And in each calendar, I created all day events -in three types of date format. A) yyyy-mm-dd B) yyyy-mm-ddZ C) -yyyy-mm-dd+(-)hh:mm only type B format always returns the correct data. -</p> -<p> -1) US calendar (all type is OK) A: input start =&gt; 2006-09-18, end =&gt; -2006-09-19 -</p> -<pre> - output start =&gt; 2006-09-18, end =&gt; 2006-09-19 -</pre> -<p> -B: input start =&gt; 2006-09-18Z,end =&gt; 2006-09-19Z -</p> -<pre> - output start =&gt; 2006-09-18, end =&gt; 2006-09-19 -</pre> -<p> -C: input start =&gt; 2006-09-18-08:00,end =&gt; 2006-09-19-08:00 -</p> -<pre> - output start =&gt; 2006-09-18, end =&gt; 2006-09-19 -</pre> -<p> -2) UK calenar (A returns wrong data. B and C is OK) A: input start =&gt; -2006-09-18, end =&gt; 2006-09-19 -</p> -<pre> - output start =&gt; 2006-09-17, end =&gt; 2006-09-18 -</pre> -<p> -B: input start =&gt; 2006-09-18Z,end =&gt; 2006-09-19Z -</p> -<pre> - output start =&gt; 2006-09-18, end =&gt; 2006-09-19 -</pre> -<p> -C: input start =&gt; 2006-09-18-00:00,end =&gt; 2006-09-19-00:00 -</p> -<pre> - output start =&gt; 2006-09-18, end =&gt; 2006-09-19 -</pre> -<p> -3) Japan calendar (A and C returns wrong data. only B is OK) A: input start -=&gt; 2006-09-18, end =&gt; 2006-09-19 -</p> -<pre> - output start =&gt; 2006-09-17, end =&gt; 2006-09-18 -</pre> -<p> -B: input start =&gt; 2006-09-18Z,end =&gt; 2006-09-19Z -</p> -<pre> - output start =&gt; 2006-09-18, end =&gt; 2006-09-19 -</pre> -<p> -C: input start =&gt; 2006-09-18+09:00,end =&gt; 2006-09-19+09:00 -</p> -<pre> - output start =&gt; 2006-09-17, end =&gt; 2006-09-18 -</pre> -<p> -convert String to Time -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000021-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000021-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 261</span> +218: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000027" class="method-detail"> + <a name="M000027"></a> + + <div class="method-heading"> + <a href="#M000027" class="method-signature"> + <span class="method-name">str_to_time</span><span class="method-args">(st)</span> + </a> + </div> + + <div class="method-description"> + <h2>Allday <a href="Event.html">Event</a> Bugs</h2> +<p> +When creating all day event, the format of gd:when startTime and gd:when +endTime must be &quot;yyyy-mm-ddZ&quot; which represents UTC. otherwise the +wrong data returns. below is the test result. I used 3 countries&#8217; +calendar. US, UK, and Japan. And in each calendar, I created all day events +in three types of date format. A) yyyy-mm-dd B) yyyy-mm-ddZ C) +yyyy-mm-dd+(-)hh:mm only type B format always returns the correct data. +</p> +<p> +1) US calendar (all type is OK) A: input start =&gt; 2006-09-18, end =&gt; +2006-09-19 +</p> +<pre> + output start =&gt; 2006-09-18, end =&gt; 2006-09-19 +</pre> +<p> +B: input start =&gt; 2006-09-18Z,end =&gt; 2006-09-19Z +</p> +<pre> + output start =&gt; 2006-09-18, end =&gt; 2006-09-19 +</pre> +<p> +C: input start =&gt; 2006-09-18-08:00,end =&gt; 2006-09-19-08:00 +</p> +<pre> + output start =&gt; 2006-09-18, end =&gt; 2006-09-19 +</pre> +<p> +2) UK calenar (A returns wrong data. B and C is OK) A: input start =&gt; +2006-09-18, end =&gt; 2006-09-19 +</p> +<pre> + output start =&gt; 2006-09-17, end =&gt; 2006-09-18 +</pre> +<p> +B: input start =&gt; 2006-09-18Z,end =&gt; 2006-09-19Z +</p> +<pre> + output start =&gt; 2006-09-18, end =&gt; 2006-09-19 +</pre> +<p> +C: input start =&gt; 2006-09-18-00:00,end =&gt; 2006-09-19-00:00 +</p> +<pre> + output start =&gt; 2006-09-18, end =&gt; 2006-09-19 +</pre> +<p> +3) Japan calendar (A and C returns wrong data. only B is OK) A: input start +=&gt; 2006-09-18, end =&gt; 2006-09-19 +</p> +<pre> + output start =&gt; 2006-09-17, end =&gt; 2006-09-18 +</pre> +<p> +B: input start =&gt; 2006-09-18Z,end =&gt; 2006-09-19Z +</p> +<pre> + output start =&gt; 2006-09-18, end =&gt; 2006-09-19 +</pre> +<p> +C: input start =&gt; 2006-09-18+09:00,end =&gt; 2006-09-19+09:00 +</p> +<pre> + output start =&gt; 2006-09-17, end =&gt; 2006-09-18 +</pre> +<p> +convert String to Time +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000027-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000027-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 261</span> 261: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">str_to_time</span>(<span class="ruby-identifier">st</span>) 262: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">nil</span> 263: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">st</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Time</span> <span class="ruby-keyword kw">then</span> 264: <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">st</span> 265: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">st</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span> <span class="ruby-keyword kw">then</span> 266: <span class="ruby-keyword kw">begin</span> 267: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">allday</span> = <span class="ruby-keyword kw">false</span> 268: <span class="ruby-identifier">ret</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">iso8601</span>(<span class="ruby-identifier">st</span>) 269: <span class="ruby-keyword kw">rescue</span> -270: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">allday</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">st</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\d{4}-\d{2}-\d{2}/</span> <span class="ruby-comment cmt"># yyyy-mm-dd</span> +270: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">allday</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">st</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\d{4}-\d{2}-\d{2}/</span> <span class="ruby-comment cmt"># yyyy-mm-dd </span> 271: <span class="ruby-identifier">ret</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">st</span>) 272: <span class="ruby-keyword kw">end</span> 273: <span class="ruby-keyword kw">end</span> 274: <span class="ruby-identifier">ret</span> -275: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000022" class="method-detail"> - <a name="M000022"></a> - - <div class="method-heading"> - <a href="#M000022" class="method-signature"> - <span class="method-name">time_to_str</span><span class="method-args">(dt)</span> - </a> - </div> - - <div class="method-description"> - <p> -returns string represents date or datetime -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000022-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000022-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 278</span> +275: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000028" class="method-detail"> + <a name="M000028"></a> + + <div class="method-heading"> + <a href="#M000028" class="method-signature"> + <span class="method-name">time_to_str</span><span class="method-args">(dt)</span> + </a> + </div> + + <div class="method-description"> + <p> +returns string represents date or datetime +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000028-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000028-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 278</span> 278: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">time_to_str</span>(<span class="ruby-identifier">dt</span>) 279: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">nil</span> 280: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dt</span>.<span class="ruby-identifier">nil?</span> 281: <span class="ruby-identifier">ret</span> = <span class="ruby-value str">&quot;&quot;</span> 282: <span class="ruby-keyword kw">else</span> 283: <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">dt</span>.<span class="ruby-identifier">iso8601</span> -284: <span class="ruby-identifier">ret</span>[<span class="ruby-value">10</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] = <span class="ruby-value str">&quot;Z&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">allday</span> <span class="ruby-comment cmt"># yyyy-mm-ddZ</span> +284: <span class="ruby-identifier">ret</span>[<span class="ruby-value">10</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] = <span class="ruby-value str">&quot;Z&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">allday</span> <span class="ruby-comment cmt"># yyyy-mm-ddZ </span> 285: <span class="ruby-keyword kw">end</span> 286: <span class="ruby-identifier">ret</span> -287: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000019" class="method-detail"> - <a name="M000019"></a> - - <div class="method-heading"> - <a href="#M000019" class="method-signature"> - <span class="method-name">xml_to_instance</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> -set xml data to attributes of an instance -</p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000019-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000019-source"> -<pre> - <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 189</span> +287: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000025" class="method-detail"> + <a name="M000025"></a> + + <div class="method-heading"> + <a href="#M000025" class="method-signature"> + <span class="method-name">xml_to_instance</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p> +set xml data to attributes of an instance +</p> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000025-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000025-source"> +<pre> + <span class="ruby-comment cmt"># File lib/googlecalendar/event.rb, line 189</span> 189: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">xml_to_instance</span> 190: <span class="ruby-constant">ATTRIBUTES_MAP</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">hash</span><span class="ruby-operator">|</span> 191: <span class="ruby-identifier">elem</span> = <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-identifier">hash</span>[<span class="ruby-value str">&quot;element&quot;</span>]] 192: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">nil?</span> 193: <span class="ruby-identifier">val</span> = (<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value str">&quot;attribute&quot;</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-identifier">hash</span>[<span class="ruby-value str">&quot;attribute&quot;</span>]] <span class="ruby-operator">:</span> <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">text</span>) @@ -778,24 +778,24 @@ 198: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> = <span class="ruby-identifier">:old</span> 199: 200: <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">elements</span>.<span class="ruby-identifier">each</span>(<span class="ruby-value str">&quot;link&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">link</span><span class="ruby-operator">|</span> 201: <span class="ruby-ivar">@feed</span> = <span class="ruby-identifier">link</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">&quot;href&quot;</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">link</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">&quot;rel&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;edit&quot;</span> 202: <span class="ruby-keyword kw">end</span> -203: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - - </div> - - - </div> - - -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> - -</body> +203: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + + </div> + + + </div> + + +<div id="validator-badges"> + <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> +</div> + +</body> </html> \ No newline at end of file