rdoc/classes/GitHub/Base.html in git_hub-0.2.0 vs rdoc/classes/GitHub/Base.html in git_hub-0.2.7

- old
+ new

@@ -1,10 +1,10 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <title>Class: GitHub::Base [zemax 0.1.0 + <title>Class: GitHub::Base [git_hub 0.2.7 ]</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <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"> @@ -90,28 +90,34 @@ <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> - <a href="#M000017">api</a>&nbsp;&nbsp; - <a href="#M000014">api</a>&nbsp;&nbsp; - <a href="#M000010">base_uri</a>&nbsp;&nbsp; + <a href="#M000019">api</a>&nbsp;&nbsp; + <a href="#M000016">base_uri</a>&nbsp;&nbsp; + <a href="#M000012">get</a>&nbsp;&nbsp; - <a href="#M000015">get</a>&nbsp;&nbsp; + <a href="#M000017">get</a>&nbsp;&nbsp; <a href="#M000009">new</a>&nbsp;&nbsp; <a href="#M000013">post</a>&nbsp;&nbsp; - <a href="#M000016">post</a>&nbsp;&nbsp; + <a href="#M000018">post</a>&nbsp;&nbsp; <a href="#M000011">request</a>&nbsp;&nbsp; + <a href="#M000010">set_attributes</a>&nbsp;&nbsp; + + <a href="#M000015">set_resource</a>&nbsp;&nbsp; + + <a href="#M000020">to_s</a>&nbsp;&nbsp; + </div> </div> </div> @@ -146,44 +152,44 @@ <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/git_hub/base.rb, line 33</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 34</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">api</span> - <span class="ruby-ivar">@@api</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">GitHub</span><span class="ruby-operator">::</span><span class="ruby-constant">Api</span>.<span class="ruby-identifier">instance</span> + <span class="ruby-ivar">@@api</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Api</span>.<span class="ruby-identifier">instance</span> <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000010" class="method-detail"> - <a name="M000010"></a> + <div id="method-M000016" class="method-detail"> + <a name="M000016"></a> <div class="method-heading"> - <a href="#M000010" class="method-signature"> + <a href="#M000016" class="method-signature"> - <span class="method-name">base_uri</span><span class="method-args">(uri)</span> + <span class="method-name">base_uri</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"> + 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/git_hub/base.rb, line 14</span> - <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">base_uri</span> <span class="ruby-identifier">uri</span> - <span class="ruby-ivar">@base_uri</span> = <span class="ruby-identifier">uri</span> - <span class="ruby-keyword kw">end</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 44</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base_uri</span> + <span class="ruby-ivar">@base_uri</span> <span class="ruby-operator">||</span> <span class="ruby-value str">''</span> + <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> @@ -206,11 +212,11 @@ <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/git_hub/base.rb, line 25</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 26</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> ={} <span class="ruby-identifier">request</span> <span class="ruby-identifier">:get</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> <span class="ruby-keyword kw">end</span> </pre> </div> @@ -236,16 +242,13 @@ <p><a class="source-toggle" href="#" onclick="toggleCode('M000009-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000009-source"> <pre> -<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 7</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 6</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">attributes</span>={}) - <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> - <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;No attr_accessor for #{key} on #{self.class}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;#{key}=&quot;</span>) - <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{key}=&quot;</span>, <span class="ruby-identifier">value</span>) - <span class="ruby-keyword kw">end</span> + <span class="ruby-identifier">set_attributes</span> <span class="ruby-identifier">attributes</span> <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -269,11 +272,11 @@ <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/git_hub/base.rb, line 29</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 30</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> = {} <span class="ruby-identifier">request</span> <span class="ruby-identifier">:post</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> <span class="ruby-keyword kw">end</span> </pre> </div> @@ -299,107 +302,204 @@ <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/git_hub/base.rb, line 19</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 18</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request</span> <span class="ruby-identifier">verb</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> = {} - <span class="ruby-identifier">res</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">verb</span>, <span class="ruby-ivar">@base_uri</span><span class="ruby-operator">+</span><span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> - <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:body</span>) <span class="ruby-comment cmt"># res.kind_of?(Net::HTTPSuccess)</span> - <span class="ruby-comment cmt">#p &quot;in show: #{res}: #{res.code}: #{res.http_version}: #{res.message}&quot;, res.body</span> + <span class="ruby-identifier">full_uri</span> = <span class="ruby-identifier">uri</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">base_uri</span><span class="ruby-operator">+</span><span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">uri</span> + <span class="ruby-comment cmt">#p &quot;request: #{verb} #{full_uri} #{params}&quot;</span> + <span class="ruby-identifier">res</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">verb</span>, <span class="ruby-identifier">full_uri</span>, <span class="ruby-identifier">params</span> + <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:body</span>) + <span class="ruby-comment cmt">#p &quot;response: #{res}: #{res.code}: #{res.http_version}: #{res.message}&quot;, res.body</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">set_resource</span><span class="method-args">(base_uri, singulars, plurals)</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/git_hub/base.rb, line 38</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_resource</span> <span class="ruby-identifier">base_uri</span>, <span class="ruby-identifier">singulars</span>, <span class="ruby-identifier">plurals</span> + <span class="ruby-ivar">@base_uri</span> = <span class="ruby-identifier">base_uri</span> + <span class="ruby-ivar">@singulars</span> = [<span class="ruby-identifier">singulars</span>].<span class="ruby-identifier">flatten</span> + <span class="ruby-ivar">@plurals</span> = [<span class="ruby-identifier">plurals</span>].<span class="ruby-identifier">flatten</span> + <span class="ruby-keyword kw">end</span> +</pre> + </div> + + </div> + </div> + + <h3 class="section-bar">Public Instance methods</h3> - <div id="method-M000017" class="method-detail"> - <a name="M000017"></a> + <div id="method-M000019" class="method-detail"> + <a name="M000019"></a> <div class="method-heading"> - <a href="#M000017" class="method-signature"> + <a href="#M000019" class="method-signature"> <span class="method-name">api</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"> + 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/git_hub/base.rb, line 54</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 97</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">api</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">api</span> <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000015" class="method-detail"> - <a name="M000015"></a> + <div id="method-M000017" class="method-detail"> + <a name="M000017"></a> <div class="method-heading"> - <a href="#M000015" class="method-signature"> + <a href="#M000017" class="method-signature"> <span class="method-name">get</span><span class="method-args">(uri, params ={})</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"> + 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/git_hub/base.rb, line 46</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 89</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> ={} <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">get</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000016" class="method-detail"> - <a name="M000016"></a> + <div id="method-M000018" class="method-detail"> + <a name="M000018"></a> <div class="method-heading"> - <a href="#M000016" class="method-signature"> + <a href="#M000018" class="method-signature"> <span class="method-name">post</span><span class="method-args">(uri, params ={})</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"> + 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/git_hub/base.rb, line 50</span> +<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 93</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> ={} <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">post</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> + <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">set_attributes</span><span class="method-args">(attributes)</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/git_hub/base.rb, line 10</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_attributes</span> <span class="ruby-identifier">attributes</span> + <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> + <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;No attr_accessor for #{key} on #{self.class}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;#{key}=&quot;</span>) + <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{key.to_s}=&quot;</span>, <span class="ruby-identifier">value</span>) + <span class="ruby-keyword kw">end</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">to_s</span><span class="method-args">()</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/git_hub/base.rb, line 101</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span> + <span class="ruby-identifier">name</span> <span class="ruby-keyword kw">end</span> </pre> </div> </div>