doc/Mushikago/Http/Client.html in mushikago-sdk-0.4.1 vs doc/Mushikago/Http/Client.html in mushikago-sdk-0.4.2
- old
+ new
@@ -336,18 +336,18 @@
<tr>
<td>
<pre class="lines">
-20
21
22
23
-24</pre>
+24
+25</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 20</span>
+ <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 21</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
<span class='ivar'>@api_key</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:api_key</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>Mushikago</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_api_key'>api_key</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='ivar'>@signer</span> <span class='op'>=</span> <span class='const'>Mushikago</span><span class='op'>::</span><span class='const'>Auth</span><span class='op'>::</span><span class='const'>Signer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:secret_key</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>Mushikago</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_secret_key'>secret_key</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
<span class='ivar'>@use_ssl</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:use_ssl</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:use_ssl</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='const'>Mushikago</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_use_ssl'>use_ssl</span>
@@ -407,16 +407,16 @@
<tr>
<td>
<pre class="lines">
-9
10
-11</pre>
+11
+12</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 9</span>
+ <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 10</span>
<span class='kw'>def</span> <span class='id identifier rubyid_api_key'>api_key</span>
<span class='ivar'>@api_key</span>
<span class='kw'>end</span></pre>
</td>
@@ -469,16 +469,16 @@
<tr>
<td>
<pre class="lines">
-12
13
-14</pre>
+14
+15</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 12</span>
+ <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 13</span>
<span class='kw'>def</span> <span class='id identifier rubyid_signer'>signer</span>
<span class='ivar'>@signer</span>
<span class='kw'>end</span></pre>
</td>
@@ -531,16 +531,16 @@
<tr>
<td>
<pre class="lines">
-15
16
-17</pre>
+17
+18</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 15</span>
+ <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 16</span>
<span class='kw'>def</span> <span class='id identifier rubyid_use_ssl'>use_ssl</span>
<span class='ivar'>@use_ssl</span>
<span class='kw'>end</span></pre>
</td>
@@ -612,11 +612,10 @@
<tr>
<td>
<pre class="lines">
-28
29
30
31
32
33
@@ -624,23 +623,34 @@
35
36
37
38
39
-40</pre>
+40
+41
+42
+43
+44
+45
+46</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 28</span>
+ <pre class="code"><span class="info file"># File 'lib/mushikago/http/client.rb', line 29</span>
<span class='kw'>def</span> <span class='id identifier rubyid_send_request'>send_request</span> <span class='id identifier rubyid_request'>request</span>
<span class='comment'># add authorization
</span> <span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>api_key</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_api_key'>api_key</span>
<span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>timestamp</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_utc'>utc</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%Y-%m-%dT%H:%M:%SZ</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_add_signature!'>add_signature!</span><span class='lparen'>(</span><span class='id identifier rubyid_signer'>signer</span><span class='rparen'>)</span>
<span class='comment'># send request
-</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTP</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span><span class='comma'>,</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='comma'>,</span> <span class='symbol'>:use_ssl</span> <span class='op'>=></span> <span class='id identifier rubyid_use_ssl'>use_ssl</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_http'>http</span><span class='op'>|</span>
+</span> <span class='id identifier rubyid_port'>port</span> <span class='op'>=</span> <span class='id identifier rubyid_use_ssl'>use_ssl</span> <span class='op'>?</span> <span class='int'>443</span> <span class='op'>:</span> <span class='int'>80</span>
+ <span class='id identifier rubyid_port'>port</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span> <span class='kw'>unless</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
+ <span class='id identifier rubyid_session'>session</span> <span class='op'>=</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTP</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span><span class='comma'>,</span> <span class='id identifier rubyid_port'>port</span><span class='rparen'>)</span>
+ <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_use_ssl'>use_ssl</span> <span class='op'>=</span> <span class='id identifier rubyid_use_ssl'>use_ssl</span>
+ <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_verify_mode'>verify_mode</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>SSL</span><span class='op'>::</span><span class='const'>VERIFY_NONE</span> <span class='kw'>if</span> <span class='id identifier rubyid_use_ssl'>use_ssl</span>
+ <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_http'>http</span><span class='op'>|</span>
<span class='id identifier rubyid_http_request'>http_request</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_to_http_request'>to_http_request</span>
<span class='id identifier rubyid_http_response'>http_response</span> <span class='op'>=</span> <span class='id identifier rubyid_http'>http</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='id identifier rubyid_http_request'>http_request</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'>Mushikago</span><span class='op'>::</span><span class='const'>Http</span><span class='op'>::</span><span class='const'>Response</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_http_response'>http_response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
@@ -652,10 +662,10 @@
</div>
</div>
<div id="footer">
- Generated on Mon Feb 20 09:55:32 2012 by
+ Generated on Mon Mar 26 17:08:26 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.7.4 (ruby-1.9.2).
</div>
</body>
\ No newline at end of file