html/classes/GoogleCalendar/Service.html in gcalapi-0.0.4 vs html/classes/GoogleCalendar/Service.html in gcalapi-0.1.0
- old
+ new
@@ -1,595 +1,306 @@
-<?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::Service</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::Service</td>
- </tr>
- <tr class="top-aligned-row">
- <td><strong>In:</strong></td>
- <td>
- <a href="../../files/lib/googlecalendar/service_rb.html">
- lib/googlecalendar/service.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">
- <p>
-This class interacts with google calendar service.
-</p>
-
- </div>
-
-
- </div>
-
- <div id="method-list">
- <h3 class="section-bar">Methods</h3>
-
- <div class="name-list">
- <a href="#M000022">calendar_list</a>
- <a href="#M000023">calendars</a>
- <a href="#M000025">delete</a>
- <a href="#M000026">insert</a>
- <a href="#M000021">new</a>
- <a href="#M000013">proxy_addr</a>
- <a href="#M000014">proxy_addr=</a>
- <a href="#M000019">proxy_pass</a>
- <a href="#M000020">proxy_pass=</a>
- <a href="#M000015">proxy_port</a>
- <a href="#M000016">proxy_port=</a>
- <a href="#M000017">proxy_user</a>
- <a href="#M000018">proxy_user=</a>
- <a href="#M000024">query</a>
- <a href="#M000027">update</a>
- </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">AUTH_SERVER</td>
- <td>=</td>
- <td class="context-item-value">"www.google.com"</td>
- <td width="3em"> </td>
- <td class="context-item-desc">
-Server name to Authenticate
-
-</td>
- </tr>
- <tr class="top-aligned-row context-row">
- <td class="context-item-name">AUTH_PATH</td>
- <td>=</td>
- <td class="context-item-value">"/accounts/ClientLogin"</td>
- <td width="3em"> </td>
- <td class="context-item-desc">
-Server Path to authenticate
-
-</td>
- </tr>
- <tr class="top-aligned-row context-row">
- <td class="context-item-name">CALENDAR_LIST_PATH</td>
- <td>=</td>
- <td class="context-item-value">"http://www.google.com/calendar/feeds/"</td>
- <td width="3em"> </td>
- <td class="context-item-desc">
-URL to get calendar list
-
-</td>
- </tr>
- </table>
- </div>
- </div>
-
-
-
-
-
-
- <!-- if method_list -->
- <div id="methods">
- <h3 class="section-bar">Public Class methods</h3>
-
- <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">new</span><span class="method-args">(email, pass)</span>
- </a>
- </div>
-
- <div class="method-description">
- <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/service.rb, line 69</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">email</span>, <span class="ruby-identifier">pass</span>)
- <span class="ruby-ivar">@email</span> = <span class="ruby-identifier">email</span>
- <span class="ruby-ivar">@pass</span> = <span class="ruby-identifier">pass</span>
- <span class="ruby-ivar">@session</span> = <span class="ruby-keyword kw">nil</span>
- <span class="ruby-ivar">@cookie</span> = <span class="ruby-keyword kw">nil</span>
- <span class="ruby-ivar">@auth</span> = <span class="ruby-keyword kw">nil</span>
- <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">proxy_addr</span><span class="method-args">()</span>
- </a>
- </div>
-
- <div class="method-description">
- <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/service.rb, line 30</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_addr</span>
- <span class="ruby-ivar">@@proxy_addr</span>
- <span class="ruby-keyword kw">end</span>
-</pre>
- </div>
- </div>
- </div>
-
- <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">proxy_addr=</span><span class="method-args">(addr)</span>
- </a>
- </div>
-
- <div class="method-description">
- <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/service.rb, line 34</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_addr=</span>(<span class="ruby-identifier">addr</span>)
- <span class="ruby-ivar">@@proxy_addr</span>=<span class="ruby-identifier">addr</span>
- <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">proxy_pass</span><span class="method-args">()</span>
- </a>
- </div>
-
- <div class="method-description">
- <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/service.rb, line 60</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_pass</span>
- <span class="ruby-ivar">@@proxy_pass</span>
- <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">proxy_pass=</span><span class="method-args">(pass)</span>
- </a>
- </div>
-
- <div class="method-description">
- <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/service.rb, line 64</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_pass=</span>(<span class="ruby-identifier">pass</span>)
- <span class="ruby-ivar">@@proxy_pass</span> = <span class="ruby-identifier">pass</span>
- <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">proxy_port</span><span class="method-args">()</span>
- </a>
- </div>
-
- <div class="method-description">
- <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/service.rb, line 40</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_port</span>
- <span class="ruby-ivar">@@proxy_port</span>
- <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">proxy_port=</span><span class="method-args">(port)</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/service.rb, line 44</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_port=</span>(<span class="ruby-identifier">port</span>)
- <span class="ruby-ivar">@@proxy_port</span> = <span class="ruby-identifier">port</span>
- <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">proxy_user</span><span class="method-args">()</span>
- </a>
- </div>
-
- <div class="method-description">
- <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/service.rb, line 50</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_user</span>
- <span class="ruby-ivar">@@proxy_user</span>
- <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">proxy_user=</span><span class="method-args">(user)</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/service.rb, line 54</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_user=</span>(<span class="ruby-identifier">user</span>)
- <span class="ruby-ivar">@@proxy_user</span> = <span class="ruby-identifier">user</span>
- <span class="ruby-keyword kw">end</span>
-</pre>
- </div>
- </div>
- </div>
-
- <h3 class="section-bar">Public Instance methods</h3>
-
- <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">calendar_list</span><span class="method-args">()</span>
- </a>
- </div>
-
- <div class="method-description">
- <p>
-get the list of user’s calendars and returns http response object
-</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/service.rb, line 80</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calendar_list</span>
- <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
- <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-constant">CALENDAR_LIST_PATH</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@email</span>)
- <span class="ruby-identifier">do_get</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-value str">"Authorization"</span> =<span class="ruby-operator">></span> <span class="ruby-node">"GoogleLogin auth=#{@auth}"</span>)
- <span class="ruby-keyword kw">end</span>
-</pre>
- </div>
- </div>
- </div>
-
- <div id="method-M000023" class="method-detail">
- <a name="M000023"></a>
-
- <div class="method-heading">
- <span class="method-name">calendars</span><span class="method-args">()</span>
- </div>
-
- <div class="method-description">
- <p>
-Alias for <a href="Service.html#M000022">calendar_list</a>
-</p>
- </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">delete</span><span class="method-args">(feed)</span>
- </a>
- </div>
-
- <div class="method-description">
- <p>
-delete an event.
-</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/service.rb, line 115</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">feed</span>)
- <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
- <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">feed</span>)
- <span class="ruby-identifier">do_post</span>(<span class="ruby-identifier">uri</span>,
- {<span class="ruby-value str">"X-HTTP-Method-Override"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"DELETE"</span>,
- <span class="ruby-value str">"Authorization"</span> =<span class="ruby-operator">></span> <span class="ruby-node">"GoogleLogin auth=#{@auth}"</span>},
- <span class="ruby-value str">"DELETE "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
- <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">insert</span><span class="method-args">(feed, event)</span>
- </a>
- </div>
-
- <div class="method-description">
- <p>
-insert an event
-</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/service.rb, line 127</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">insert</span>(<span class="ruby-identifier">feed</span>, <span class="ruby-identifier">event</span>)
- <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
- <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">feed</span>)
- <span class="ruby-identifier">do_post</span>(<span class="ruby-identifier">uri</span>,
- {<span class="ruby-value str">"Authorization"</span> =<span class="ruby-operator">></span> <span class="ruby-node">"GoogleLogin auth=#{@auth}"</span>,
- <span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"application/atom+xml"</span>,
- <span class="ruby-value str">"Content-Length"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">event</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_s</span>}, <span class="ruby-identifier">event</span>)
- <span class="ruby-keyword kw">end</span>
-</pre>
- </div>
- </div>
- </div>
-
- <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">query</span><span class="method-args">(cal_url, conditions)</span>
- </a>
- </div>
-
- <div class="method-description">
- <p>
-send query for events of a calendar and returns http response object.
-available condtions are
-</p>
-<ul>
-<li>:q => query string
-
-</li>
-<li>:max-results => max contents count. (default: 25)
-
-</li>
-<li>:start-index => 1-based index of the first result to be retrieved
-
-</li>
-<li>:orderby => the order of retrieved data.
-
-</li>
-<li>:published-min => Bounds on the entry publication date(oldest)
-
-</li>
-<li>:published-max => Bounds on the entry publication date(newest)
-
-</li>
-<li>:updated-min => Bounds on the entry update date(oldest)
-
-</li>
-<li>:updated-max => Bounds on the entry update date(newest)
-
-</li>
-<li>:author => Entry author
-
-</li>
-</ul>
-<p>
-For detail, see <a
-href="http://code.google.com/apis/gdata/protocol.html#Queries">code.google.com/apis/gdata/protocol.html#Queries</a>
-</p>
- <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/service.rb, line 103</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query</span>(<span class="ruby-identifier">cal_url</span>, <span class="ruby-identifier">conditions</span>)
- <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
- <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">cal_url</span>)
- <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span> = <span class="ruby-identifier">conditions</span>.<span class="ruby-identifier">map</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>
- <span class="ruby-node">"#{key}=#{URI.escape(val.kind_of?(Time) ? val.getutc.iso8601 : val.to_s)}"</span>
- <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"&"</span>)
- <span class="ruby-identifier">do_get</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-value str">"Authorization"</span> =<span class="ruby-operator">></span> <span class="ruby-node">"GoogleLogin auth=#{@auth}"</span>)
- <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">update</span><span class="method-args">(feed, event)</span>
- </a>
- </div>
-
- <div class="method-description">
- <p>
-update an event.
-</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/service.rb, line 139</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">feed</span>, <span class="ruby-identifier">event</span>)
- <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
- <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">feed</span>)
- <span class="ruby-identifier">do_post</span>(<span class="ruby-identifier">uri</span>,
- {<span class="ruby-value str">"X-HTTP-Method-Override"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"PUT"</span>,
- <span class="ruby-value str">"Authorization"</span> =<span class="ruby-operator">></span> <span class="ruby-node">"GoogleLogin auth=#{@auth}"</span>,
- <span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"application/atom+xml"</span>,
- <span class="ruby-value str">"Content-Length"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">event</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_s</span>}, <span class="ruby-identifier">event</span>)
- <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>
+<?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::Service</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::Service</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../files/lib/googlecalendar/service_rb.html">
+ lib/googlecalendar/service.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ <tr class="top-aligned-row">
+ <td><strong>Parent:</strong></td>
+ <td>
+ <a href="ServiceBase.html">
+ ServiceBase
+ </a>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+This class interacts with google calendar service. If you want to use
+ClientLogin for authentication, use this class. If you want to use AuthSub,
+use <a href="ServiceAuthSub.html">ServiceAuthSub</a>.
+</p>
+
+ </div>
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000050">add_authorize_header</a>
+ <a href="#M000049">auth</a>
+ <a href="#M000046">calendar_list</a>
+ <a href="#M000047">calendars</a>
+ <a href="#M000048">new</a>
+ </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">AUTH_PATH</td>
+ <td>=</td>
+ <td class="context-item-value">"/accounts/ClientLogin"</td>
+ <td width="3em"> </td>
+ <td class="context-item-desc">
+Server Path to authenticate
+
+</td>
+ </tr>
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">CALENDAR_LIST_PATH</td>
+ <td>=</td>
+ <td class="context-item-value">"http://www.google.com/calendar/feeds/"</td>
+ <td width="3em"> </td>
+ <td class="context-item-desc">
+URL to get calendar list
+
+</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Class methods</h3>
+
+ <div id="method-M000048" class="method-detail">
+ <a name="M000048"></a>
+
+ <div class="method-heading">
+ <a href="#M000048" class="method-signature">
+ <span class="method-name">new</span><span class="method-args">(email, pass)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000048-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 31</span>
+31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">email</span>, <span class="ruby-identifier">pass</span>)
+32: <span class="ruby-ivar">@email</span> = <span class="ruby-identifier">email</span>
+33: <span class="ruby-ivar">@pass</span> = <span class="ruby-identifier">pass</span>
+34: <span class="ruby-ivar">@session</span> = <span class="ruby-keyword kw">nil</span>
+35: <span class="ruby-ivar">@cookie</span> = <span class="ruby-keyword kw">nil</span>
+36: <span class="ruby-ivar">@auth</span> = <span class="ruby-keyword kw">nil</span>
+37: <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000046" class="method-detail">
+ <a name="M000046"></a>
+
+ <div class="method-heading">
+ <a href="#M000046" class="method-signature">
+ <span class="method-name">calendar_list</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+get the list of user‘s <a href="Service.html#M000047">calendars</a>
+and returns http response object
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000046-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 20</span>
+20: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calendar_list</span>
+21: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">"-- calendar list st --"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span>
+22: <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
+23: <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-constant">CALENDAR_LIST_PATH</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@email</span>)
+24: <span class="ruby-identifier">res</span> = <span class="ruby-identifier">do_get</span>(<span class="ruby-identifier">uri</span>, {})
+25: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">"-- calendar list en(#{res.message}) --"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span>
+26: <span class="ruby-identifier">res</span>
+27: <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <div id="method-M000047" class="method-detail">
+ <a name="M000047"></a>
+
+ <div class="method-heading">
+ <span class="method-name">calendars</span><span class="method-args">()</span>
+ </div>
+
+ <div class="method-description">
+ <p>
+Alias for <a href="Service.html#M000046">calendar_list</a>
+</p>
+ </div>
+ </div>
+
+ <h3 class="section-bar">Private Instance methods</h3>
+
+ <div id="method-M000050" class="method-detail">
+ <a name="M000050"></a>
+
+ <div class="method-heading">
+ <a href="#M000050" class="method-signature">
+ <span class="method-name">add_authorize_header</span><span class="method-args">(header)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000050-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 62</span>
+62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_authorize_header</span>(<span class="ruby-identifier">header</span>)
+63: <span class="ruby-identifier">header</span>[<span class="ruby-value str">"Authorization"</span>] = <span class="ruby-node">"GoogleLogin auth=#{@auth}"</span>
+64: <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <div id="method-M000049" class="method-detail">
+ <a name="M000049"></a>
+
+ <div class="method-heading">
+ <a href="#M000049" class="method-signature">
+ <span class="method-name">auth</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000049-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 40</span>
+40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">auth</span>
+41: <span class="ruby-identifier">https</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">AUTH_SERVER</span>, <span class="ruby-value">443</span>, <span class="ruby-ivar">@@proxy_addr</span>, <span class="ruby-ivar">@@proxy_port</span>, <span class="ruby-ivar">@@proxy_user</span>, <span class="ruby-ivar">@@proxy_pass</span>)
+42: <span class="ruby-identifier">https</span>.<span class="ruby-identifier">use_ssl</span> = <span class="ruby-keyword kw">true</span>
+43: <span class="ruby-identifier">https</span>.<span class="ruby-identifier">verify_mode</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_NONE</span>
+44: <span class="ruby-identifier">head</span> = {<span class="ruby-value str">'Content-Type'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'application/x-www-form-urlencoded'</span>}
+45: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">"-- auth st --"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span>
+46: <span class="ruby-identifier">https</span>.<span class="ruby-identifier">start</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
+47: <span class="ruby-identifier">res</span> = <span class="ruby-identifier">w</span>.<span class="ruby-identifier">post</span>(<span class="ruby-constant">AUTH_PATH</span>, <span class="ruby-node">"Email=#{@email}&Passwd=#{@pass}&source=company-app-1&service=cl"</span>, <span class="ruby-identifier">head</span>)
+48: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-identifier">res</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span>
+49: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Auth=(.+)/</span>
+50: <span class="ruby-ivar">@auth</span> = <span class="ruby-identifier">$1</span>
+51: <span class="ruby-keyword kw">else</span>
+52: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span>
+53: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">fatal</span>(<span class="ruby-identifier">res</span>)
+54: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">fatal</span>(<span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>)
+55: <span class="ruby-keyword kw">end</span>
+56: <span class="ruby-identifier">raise</span> <span class="ruby-constant">AuthenticationFailed</span>
+57: <span class="ruby-keyword kw">end</span>
+58: <span class="ruby-keyword kw">end</span>
+59: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">"-- auth en --"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span>
+60: <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