doc/Pupil/Stream.html in pupil-0.1.1 vs doc/Pupil/Stream.html in pupil-0.1.2

- old
+ new

@@ -4,11 +4,11 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Class: Pupil::Stream - &mdash; Documentation by YARD 0.7.3 + &mdash; Documentation by YARD 0.7.4 </title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" /> @@ -96,11 +96,11 @@ <p class="children"> - <strong class="classes">Classes:</strong> <span class='object_link'><a href="Stream/StreamError.html" title="Pupil::Stream::StreamError (class)">StreamError</a></span>, <span class='object_link'><a href="Stream/StreamEvent.html" title="Pupil::Stream::StreamEvent (class)">StreamEvent</a></span> + <strong class="classes">Classes:</strong> <span class='object_link'><a href="Stream/Shash.html" title="Pupil::Stream::Shash (class)">Shash</a></span>, <span class='object_link'><a href="Stream/Status.html" title="Pupil::Stream::Status (class)">Status</a></span>, <span class='object_link'><a href="Stream/StreamError.html" title="Pupil::Stream::StreamError (class)">StreamError</a></span> </p> <h2>Constant Summary</h2> @@ -117,13 +117,45 @@ </dl> + <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2> + <ul class="summary"> + + <li class="public "> + <span class="summary_signature"> + + <a href="#screen_name-instance_method" title="#screen_name (instance method)">- (Object) <strong>screen_name</strong> </a> + + + </span> + + + <span class="note title readonly">readonly</span> + + + + + + + + <span class="summary_desc"><div class='inline'><p> +Returns the value of attribute screen_name. +</p> +</div></span> + +</li> + + </ul> + + + + <h2> Instance Method Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small> </h2> @@ -131,10 +163,31 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> + <a href="#guess_event-instance_method" title="#guess_event (instance method)">- (Object) <strong>guess_event</strong>(status) </a> + + + + </span> + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + <a href="#initialize-instance_method" title="#initialize (instance method)">- (Stream) <strong>initialize</strong>(key) </a> </span> @@ -178,11 +231,11 @@ <li class="public "> <span class="summary_signature"> - <a href="#start-instance_method" title="#start (instance method)">- (Object) <strong>start</strong>(type, param = nil, &amp;block) </a> + <a href="#start-instance_method" title="#start (instance method)">- (Pupil::Stream::Shash, Pupil::Stream::Status) <strong>start</strong>(type, param = nil, &amp;block) </a> </span> @@ -191,11 +244,15 @@ - <span class="summary_desc"><div class='inline'></div></span> + <span class="summary_desc"><div class='inline'><p> +Event variable supported :status, :retweeted, :favorite, :friends and +:delete. +</p> +</div></span> </li> </ul> @@ -227,11 +284,10 @@ <tr> <td> <pre class="lines"> -9 10 11 12 13 14 @@ -241,47 +297,144 @@ 18 19 20 21 22 -23 -24</pre> +23</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 9</span> + <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 10</span> -<span class='kw'>def</span> <span class='id initialize'>initialize</span> <span class='id key'>key</span> - <span class='ivar'>@screen_name</span> <span class='op'>=</span> <span class='id key'>key</span><span class='lbracket'>[</span><span class='symbol'>:screen_name</span><span class='rbracket'>]</span> - <span class='ivar'>@client</span> <span class='op'>=</span> <span class='kw'>nil</span> - <span class='ivar'>@config</span> <span class='op'>=</span> <span class='kw'>nil</span> +<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_key'>key</span> + <span class='ivar'>@screen_name</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:screen_name</span><span class='rbracket'>]</span> - <span class='ivar'>@consumer</span> <span class='op'>=</span> <span class='const'>OAuth</span><span class='op'>::</span><span class='const'>Consumer</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span> - <span class='id key'>key</span><span class='lbracket'>[</span><span class='symbol'>:consumer_key</span><span class='rbracket'>]</span><span class='comma'>,</span> - <span class='id key'>key</span><span class='lbracket'>[</span><span class='symbol'>:consumer_secret</span><span class='rbracket'>]</span><span class='comma'>,</span> + <span class='ivar'>@consumer</span> <span class='op'>=</span> <span class='const'>OAuth</span><span class='op'>::</span><span class='const'>Consumer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> + <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:consumer_key</span><span class='rbracket'>]</span><span class='comma'>,</span> + <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:consumer_secret</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:site</span> <span class='op'>=&gt;</span> <span class='const'>TWITTER_API_URL</span> <span class='rparen'>)</span> - <span class='ivar'>@access_token</span> <span class='op'>=</span> <span class='const'>OAuth</span><span class='op'>::</span><span class='const'>AccessToken</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span> + <span class='ivar'>@access_token</span> <span class='op'>=</span> <span class='const'>OAuth</span><span class='op'>::</span><span class='const'>AccessToken</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='ivar'>@consumer</span><span class='comma'>,</span> - <span class='id key'>key</span><span class='lbracket'>[</span><span class='symbol'>:access_token</span><span class='rbracket'>]</span><span class='comma'>,</span> - <span class='id key'>key</span><span class='lbracket'>[</span><span class='symbol'>:access_token_secret</span><span class='rbracket'>]</span> + <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:access_token</span><span class='rbracket'>]</span><span class='comma'>,</span> + <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:access_token_secret</span><span class='rbracket'>]</span> <span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> + <div id="instance_attr_details" class="attr_details"> + <h2>Instance Attribute Details</h2> + + + <span id=""></span> + <span id="screen_name-instance_method"></span> + <div class="method_details first"> + <p class="signature first" id="screen_name-instance_method"> + + - (<tt>Object</tt>) <strong>screen_name</strong> <span class="extras">(readonly)</span> + + +</p><div class="docstring"> + <div class="discussion"> + <p> +Returns the value of attribute screen_name +</p> + + + </div> +</div> +<div class="tags"> + + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +3 +4 +5</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 3</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_screen_name'>screen_name</span> + <span class='ivar'>@screen_name</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + </div> + + <div id="instance_method_details" class="method_details_list"> <h2>Instance Method Details</h2> <div class="method_details first"> - <p class="signature first" id="run_get_stream-instance_method"> + <p class="signature first" id="guess_event-instance_method"> + - (<tt>Object</tt>) <strong>guess_event</strong>(status) + + + +</p><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 70</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_guess_event'>guess_event</span> <span class='id identifier rubyid_status'>status</span> + <span class='kw'>if</span> <span class='id identifier rubyid_status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>delete</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> + <span class='kw'>return</span> <span class='const'>Shash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:delete</span><span class='comma'>,</span> <span class='id identifier rubyid_status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>delete</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>status</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> + <span class='kw'>elsif</span> <span class='id identifier rubyid_status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>friends</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> + <span class='kw'>return</span> <span class='const'>Shash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:friends</span><span class='comma'>,</span> <span class='id identifier rubyid_status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>friends</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> + <span class='kw'>elsif</span> <span class='id identifier rubyid_status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>event</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>favorite</span><span class='tstring_end'>&quot;</span></span> + <span class='kw'>return</span> <span class='const'>Shash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:favorite</span><span class='comma'>,</span> <span class='id identifier rubyid_status'>status</span><span class='rparen'>)</span> + <span class='kw'>elsif</span> <span class='id identifier rubyid_status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>retweeted_status</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> + <span class='kw'>return</span> <span class='const'>Status</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='symbol'>:retweeted</span><span class='rparen'>)</span> + <span class='kw'>elsif</span> <span class='id identifier rubyid_status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> + <span class='kw'>return</span> <span class='const'>Status</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_status'>status</span><span class='rparen'>)</span> + <span class='kw'>else</span> + <span class='kw'>return</span> <span class='const'>Shash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:unknown</span><span class='comma'>,</span> <span class='id identifier rubyid_status'>status</span><span class='rparen'>)</span> + <span class='kw'>end</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <p class="signature " id="run_get_stream-instance_method"> + - (<tt>Object</tt>) <strong>run_get_stream</strong>(type, param = nil, &amp;block) </p><table class="source_code"> @@ -323,48 +476,50 @@ 62 63 64 65 66 -67</pre> +67 +68</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 32</span> -<span class='kw'>def</span> <span class='id run_get_stream'>run_get_stream</span><span class='lparen'>(</span><span class='id type'>type</span><span class='comma'>,</span> <span class='id param'>param</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span><span class='rparen'>)</span> - <span class='id uri'>uri</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id parse'>parse</span><span class='lparen'>(</span><span class='const'>STREAM_APIS</span><span class='lbracket'>[</span><span class='id type'>type</span><span class='rbracket'>]</span> <span class='op'>%</span> <span class='const'>Pupil</span><span class='period'>.</span><span class='id param_serializer'>param_serializer</span><span class='lparen'>(</span><span class='id param'>param</span><span class='rparen'>)</span><span class='rparen'>)</span> - <span class='id https'>https</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 new'>new</span><span class='lparen'>(</span><span class='id uri'>uri</span><span class='period'>.</span><span class='id host'>host</span><span class='comma'>,</span> <span class='id uri'>uri</span><span class='period'>.</span><span class='id port'>port</span><span class='rparen'>)</span> - <span class='id https'>https</span><span class='period'>.</span><span class='id use_ssl'>use_ssl</span> <span class='op'>=</span> <span class='kw'>true</span> - <span class='id https'>https</span><span class='period'>.</span><span class='id 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='id https'>https</span><span class='period'>.</span><span class='id verify_depth'>verify_depth</span> <span class='op'>=</span> <span class='int'>5</span> +<span class='kw'>def</span> <span class='id identifier rubyid_run_get_stream'>run_get_stream</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> + <span class='id identifier rubyid_uri'>uri</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='const'>STREAM_APIS</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span> <span class='op'>%</span> <span class='const'>Pupil</span><span class='period'>.</span><span class='id identifier rubyid_param_serializer'>param_serializer</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span><span class='rparen'>)</span> + <span class='id identifier rubyid_https'>https</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_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span><span class='comma'>,</span> <span class='id identifier rubyid_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='rparen'>)</span> + <span class='id identifier rubyid_https'>https</span><span class='period'>.</span><span class='id identifier rubyid_use_ssl'>use_ssl</span> <span class='op'>=</span> <span class='kw'>true</span> + <span class='id identifier rubyid_https'>https</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='id identifier rubyid_https'>https</span><span class='period'>.</span><span class='id identifier rubyid_verify_depth'>verify_depth</span> <span class='op'>=</span> <span class='int'>5</span> <span class='kw'>while</span> <span class='kw'>true</span> <span class='kw'>do</span> <span class='kw'>begin</span> - <span class='id https'>https</span><span class='period'>.</span><span class='id start'>start</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id https'>https</span><span class='op'>|</span> - <span class='id request'>request</span> <span class='op'>=</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTP</span><span class='op'>::</span><span class='const'>Get</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id uri'>uri</span><span class='period'>.</span><span class='id request_uri'>request_uri</span><span class='rparen'>)</span> - <span class='id request'>request</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>User-Agent</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Ruby/</span><span class='embexpr_beg'>#{</span><span class='const'>RUBY_VERSION</span><span class='rbrace'>}</span><span class='tstring_content'> Pupil::Stream</span><span class='tstring_end'>&quot;</span></span> - <span class='id request'>request</span><span class='period'>.</span><span class='id oauth!'>oauth!</span><span class='lparen'>(</span><span class='id https'>https</span><span class='comma'>,</span> <span class='ivar'>@consumer</span><span class='comma'>,</span> <span class='ivar'>@access_token</span><span class='rparen'>)</span> - <span class='id buf'>buf</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span> - <span class='id https'>https</span><span class='period'>.</span><span class='id request'>request</span><span class='lparen'>(</span><span class='id request'>request</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id response'>response</span><span class='op'>|</span> - <span class='id response'>response</span><span class='period'>.</span><span class='id read_body'>read_body</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id chunk'>chunk</span><span class='op'>|</span> - <span class='id buf'>buf</span> <span class='op'>&lt;&lt;</span> <span class='id chunk'>chunk</span> - <span class='kw'>while</span> <span class='lparen'>(</span><span class='id line'>line</span> <span class='op'>=</span> <span class='id buf'>buf</span><span class='lbracket'>[</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.+?(\r\n)+</span><span class='regexp_end'>/m</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='kw'>nil</span> + <span class='id identifier rubyid_https'>https</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_https'>https</span><span class='op'>|</span> + <span class='id identifier rubyid_request'>request</span> <span class='op'>=</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTP</span><span class='op'>::</span><span class='const'>Get</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'>uri</span><span class='period'>.</span><span class='id identifier rubyid_request_uri'>request_uri</span><span class='rparen'>)</span> + <span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>User-Agent</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Ruby/</span><span class='embexpr_beg'>#{</span><span class='const'>RUBY_VERSION</span><span class='rbrace'>}</span><span class='tstring_content'> Pupil::Stream</span><span class='tstring_end'>&quot;</span></span> + <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_oauth!'>oauth!</span><span class='lparen'>(</span><span class='id identifier rubyid_https'>https</span><span class='comma'>,</span> <span class='ivar'>@consumer</span><span class='comma'>,</span> <span class='ivar'>@access_token</span><span class='rparen'>)</span> + <span class='id identifier rubyid_buf'>buf</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span> + <span class='id identifier rubyid_https'>https</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_response'>response</span><span class='op'>|</span> + <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_read_body'>read_body</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_chunk'>chunk</span><span class='op'>|</span> + <span class='id identifier rubyid_buf'>buf</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_chunk'>chunk</span> + <span class='kw'>while</span> <span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='id identifier rubyid_buf'>buf</span><span class='lbracket'>[</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.+?(\r\n)+</span><span class='regexp_end'>/m</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>begin</span> - <span class='id buf'>buf</span><span class='period'>.</span><span class='id sub!'>sub!</span><span class='lparen'>(</span><span class='id line'>line</span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> - <span class='id line'>line</span><span class='period'>.</span><span class='id strip!'>strip!</span> - <span class='id status'>status</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id parse'>parse</span><span class='lparen'>(</span><span class='id line'>line</span><span class='rparen'>)</span> + <span class='id identifier rubyid_buf'>buf</span><span class='period'>.</span><span class='id identifier rubyid_sub!'>sub!</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> + <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_strip!'>strip!</span> + <span class='id identifier rubyid_status'>status</span> <span class='op'>=</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_line'>line</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>break</span> <span class='kw'>end</span> - <span class='id block'>block</span><span class='period'>.</span><span class='id call'>call</span> <span class='const'>StreamEvent</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id status'>status</span><span class='rparen'>)</span> + <span class='id identifier rubyid_event'>event</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_guess_event'>guess_event</span> <span class='id identifier rubyid_status'>status</span> + <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='id identifier rubyid_event'>event</span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='kw'>end</span> - <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id vars'>vars</span> - <span class='id raise'>raise</span> <span class='const'>StreamError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>StreamError: </span><span class='embexpr_beg'>#{</span><span class='id vars'>vars</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span> + <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_vars'>vars</span> + <span class='id identifier rubyid_raise'>raise</span> <span class='const'>StreamError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>StreamError: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_vars'>vars</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> @@ -372,22 +527,46 @@ </div> <div class="method_details "> <p class="signature " id="start-instance_method"> - - (<tt>Object</tt>) <strong>start</strong>(type, param = nil, &amp;block) + - (<tt><span class='object_link'><a href="Stream/Shash.html" title="Pupil::Stream::Shash (class)">Pupil::Stream::Shash</a></span></tt>, <tt><span class='object_link'><a href="Stream/Status.html" title="Pupil::Stream::Status (class)">Pupil::Stream::Status</a></span></tt>) <strong>start</strong>(type, param = nil, &amp;block) </p><div class="docstring"> <div class="discussion"> - + <p> +Event variable supported :status, :retweeted, :favorite, :friends and +:delete +</p> + </div> </div> <div class="tags"> +<h3>Returns:</h3> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="Stream/Shash.html" title="Pupil::Stream::Shash (class)">Pupil::Stream::Shash</a></span></tt>, <tt><span class='object_link'><a href="Stream/Status.html" title="Pupil::Stream::Status (class)">Pupil::Stream::Status</a></span></tt>)</span> + + + + &mdash; + <div class='inline'><p> +event variable supported :status, :retweeted, :favorite, :friends and +:delete +</p> +</div> + + </li> + +</ul> <h3>Raises:</h3> <ul class="raise"> <li> @@ -413,14 +592,14 @@ 30</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 26</span> -<span class='kw'>def</span> <span class='id start'>start</span><span class='lparen'>(</span><span class='id type'>type</span><span class='comma'>,</span> <span class='id param'>param</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span><span class='rparen'>)</span> - <span class='id raise'>raise</span> <span class='const'>ArgumentError</span> <span class='kw'>unless</span> <span class='id block_given?'>block_given?</span> +<span class='kw'>def</span> <span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> + <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block_given?'>block_given?</span> - <span class='id run_get_stream'>run_get_stream</span> <span class='id type'>type</span><span class='comma'>,</span> <span class='id param'>param</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span> + <span class='id identifier rubyid_run_get_stream'>run_get_stream</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> @@ -428,12 +607,12 @@ </div> </div> <div id="footer"> - Generated on Fri Dec 16 17:19:17 2011 by + Generated on Sat Dec 17 20:58:33 2011 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.7.3 (ruby-1.9.2). + 0.7.4 (ruby-1.9.2). </div> </body> </html> \ No newline at end of file