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

- old
+ new

@@ -1,306 +1,246 @@ -<?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>&nbsp;&nbsp; - <a href="#M000049">auth</a>&nbsp;&nbsp; - <a href="#M000046">calendar_list</a>&nbsp;&nbsp; - <a href="#M000047">calendars</a>&nbsp;&nbsp; - <a href="#M000048">new</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">AUTH_PATH</td> - <td>=</td> - <td class="context-item-value">&quot;/accounts/ClientLogin&quot;</td> - <td width="3em">&nbsp;</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">&quot;http://www.google.com/calendar/feeds/&quot;</td> - <td width="3em">&nbsp;</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&#8216;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">&quot;-- calendar list st --&quot;</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">&quot;-- calendar list en(#{res.message}) --&quot;</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">&quot;Authorization&quot;</span>] = <span class="ruby-node">&quot;GoogleLogin auth=#{@auth}&quot;</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">&gt;</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">&quot;-- auth st --&quot;</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">&quot;Email=#{@email}&amp;Passwd=#{@pass}&amp;source=company-app-1&amp;service=cl&quot;</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">&quot;-- auth en --&quot;</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> +<?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>&nbsp;&nbsp; + <a href="#M000049">auth</a>&nbsp;&nbsp; + <a href="#M000048">new</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">AUTH_PATH</td> + <td>=</td> + <td class="context-item-value">&quot;/accounts/ClientLogin&quot;</td> + <td width="3em">&nbsp;</td> + <td class="context-item-desc"> +Server Path to authenticate + +</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 14</span> +14: <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>) +15: <span class="ruby-ivar">@email</span> = <span class="ruby-identifier">email</span> +16: <span class="ruby-ivar">@pass</span> = <span class="ruby-identifier">pass</span> +17: <span class="ruby-ivar">@session</span> = <span class="ruby-keyword kw">nil</span> +18: <span class="ruby-ivar">@cookie</span> = <span class="ruby-keyword kw">nil</span> +19: <span class="ruby-ivar">@auth</span> = <span class="ruby-keyword kw">nil</span> +20: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </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 45</span> +45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_authorize_header</span>(<span class="ruby-identifier">header</span>) +46: <span class="ruby-identifier">header</span>[<span class="ruby-value str">&quot;Authorization&quot;</span>] = <span class="ruby-node">&quot;GoogleLogin auth=#{@auth}&quot;</span> +47: <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 23</span> +23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">auth</span> +24: <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>) +25: <span class="ruby-identifier">https</span>.<span class="ruby-identifier">use_ssl</span> = <span class="ruby-keyword kw">true</span> +26: <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> +27: <span class="ruby-identifier">head</span> = {<span class="ruby-value str">'Content-Type'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'application/x-www-form-urlencoded'</span>} +28: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;-- auth st --&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span> +29: <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> +30: <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">&quot;Email=#{@email}&amp;Passwd=#{CGI.escape(@pass)}&amp;source=company-app-1&amp;service=cl&quot;</span>, <span class="ruby-identifier">head</span>) +31: <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> +32: <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> +33: <span class="ruby-ivar">@auth</span> = <span class="ruby-identifier">$1</span> +34: <span class="ruby-keyword kw">else</span> +35: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span> +36: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">fatal</span>(<span class="ruby-identifier">res</span>) +37: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">fatal</span>(<span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>) +38: <span class="ruby-keyword kw">end</span> +39: <span class="ruby-identifier">raise</span> <span class="ruby-constant">AuthenticationFailed</span> +40: <span class="ruby-keyword kw">end</span> +41: <span class="ruby-keyword kw">end</span> +42: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;-- auth en --&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logger</span> +43: <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