]> git.r.bdr.sh - rbdr/lyricli.rb/blobdiff - doc/Lyricli/LyricsEngine.html
Document the errors... ish?
[rbdr/lyricli.rb] / doc / Lyricli / LyricsEngine.html
index 5cca7958558a526d94e96ebca7b9945fe9472849..4d7c6694d47d24a0024121451866c0a0cf5e8b28 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Class: Lyricli::LyricsEngine
   
 <title>
   Class: Lyricli::LyricsEngine
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
   
 </title>
 
 </dl>
 <div class="clear"></div>
 
 </dl>
 <div class="clear"></div>
 
+<h2>Overview</h2><div class="docstring">
+  <div class="discussion">
+    <p>
+This class gets the lyrics according to a given artist and song name.
+</p>
 
 
 
 
+  </div>
+</div>
+<div class="tags">
+  
+
+</div>
+
 
 
 
 
 
 
         <li class="public ">
   <span class="summary_signature">
     
         <li class="public ">
   <span class="summary_signature">
     
-      <a href="#get_lyrics-instance_method" title="#get_lyrics (instance method)">- (Object) <strong>get_lyrics</strong> </a>
+      <a href="#get_lyrics-instance_method" title="#get_lyrics (instance method)">- (String) <strong>get_lyrics</strong> </a>
     
 
     
     
 
     
   
 
   
   
 
   
-    <span class="summary_desc"><div class='inline'></div></span>
+    <span class="summary_desc"><div class='inline'><p>
+Asks Lyrics Wiki for the lyrics, also cleans up the output a little.
+</p>
+</div></span>
   
 </li>
 
   
 </li>
 
 
   
     <span class="summary_desc"><div class='inline'><p>
 
   
     <span class="summary_desc"><div class='inline'><p>
-A new instance of LyricsEngine.
+Starts a new instance of LyricsEngine.
 </p>
 </div></span>
   
 </p>
 </div></span>
   
@@ -196,14 +211,52 @@ A new instance of LyricsEngine.
 </h3><div class="docstring">
   <div class="discussion">
     <p>
 </h3><div class="docstring">
   <div class="discussion">
     <p>
-A new instance of LyricsEngine
+Starts a new instance of LyricsEngine
 </p>
 
 
   </div>
 </div>
 <div class="tags">
 </p>
 
 
   </div>
 </div>
 <div class="tags">
+  <p class="tag_title">Parameters:</p>
+<ul class="param">
+  
+    <li>
+      
+        <span class='name'>artist</span>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the artist
+</p>
+</div>
+      
+    </li>
+  
+    <li>
+      
+        <span class='name'>song</span>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the song to look for
+</p>
+</div>
+      
+    </li>
   
   
+</ul>
+
 
 </div><table class="source_code">
   <tr>
 
 </div><table class="source_code">
   <tr>
@@ -211,12 +264,12 @@ A new instance of LyricsEngine
       <pre class="lines">
 
 
       <pre class="lines">
 
 
-6
-7
-8</pre>
+12
+13
+14</pre>
     </td>
     <td>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/lyrics_engine.rb', line 6</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/lyrics_engine.rb', line 12</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_artist'>artist</span><span class='comma'>,</span> <span class='id identifier rubyid_song'>song</span><span class='rparen'>)</span>
   <span class='ivar'>@provider</span> <span class='op'>=</span> <span class='const'>URI</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://lyrics.wikia.com/api.php?artist=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sanitize_param'>sanitize_param</span> <span class='id identifier rubyid_artist'>artist</span><span class='rbrace'>}</span><span class='tstring_content'>&amp;song=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sanitize_param'>sanitize_param</span> <span class='id identifier rubyid_song'>song</span><span class='rbrace'>}</span><span class='tstring_content'>&amp;fmt=realjson</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_artist'>artist</span><span class='comma'>,</span> <span class='id identifier rubyid_song'>song</span><span class='rparen'>)</span>
   <span class='ivar'>@provider</span> <span class='op'>=</span> <span class='const'>URI</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://lyrics.wikia.com/api.php?artist=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sanitize_param'>sanitize_param</span> <span class='id identifier rubyid_artist'>artist</span><span class='rbrace'>}</span><span class='tstring_content'>&amp;song=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sanitize_param'>sanitize_param</span> <span class='id identifier rubyid_song'>song</span><span class='rbrace'>}</span><span class='tstring_content'>&amp;fmt=realjson</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
@@ -236,27 +289,49 @@ A new instance of LyricsEngine
       <div class="method_details first">
   <h3 class="signature first" id="get_lyrics-instance_method">
   
       <div class="method_details first">
   <h3 class="signature first" id="get_lyrics-instance_method">
   
-    - (<tt>Object</tt>) <strong>get_lyrics</strong> 
+    - (<tt>String</tt>) <strong>get_lyrics</strong> 
   
 
   
 
   
   
 
   
 
   
-</h3><table class="source_code">
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Asks Lyrics Wiki for the lyrics, also cleans up the output a little.
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the lyrics
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
   <tr>
     <td>
       <pre class="lines">
 
 
-10
-11
-12
-13
-14
-15
-16
-17
-18
 19
 20
 21
 19
 20
 21
@@ -268,10 +343,19 @@ A new instance of LyricsEngine
 27
 28
 29
 27
 28
 29
-30</pre>
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39</pre>
     </td>
     <td>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/lyrics_engine.rb', line 10</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/lyrics_engine.rb', line 19</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
   <span class='kw'>begin</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
   <span class='kw'>begin</span>
@@ -281,7 +365,7 @@ A new instance of LyricsEngine
     <span class='id identifier rubyid_doc'>doc</span> <span class='op'>=</span> <span class='const'>Nokogiri</span><span class='op'>::</span><span class='const'>HTML</span><span class='lparen'>(</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>url</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
     <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.lyricbox</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
   <span class='kw'>rescue</span>
     <span class='id identifier rubyid_doc'>doc</span> <span class='op'>=</span> <span class='const'>Nokogiri</span><span class='op'>::</span><span class='const'>HTML</span><span class='lparen'>(</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>url</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
     <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.lyricbox</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
   <span class='kw'>rescue</span>
-    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Lyricli</span><span class='op'>::</span><span class='const'>LyricsNotFoundException</span>
+    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>LyricsNotFoundError</span>
   <span class='kw'>end</span>
 
   <span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.rtMatcher</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span>
   <span class='kw'>end</span>
 
   <span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.rtMatcher</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span>
@@ -304,9 +388,9 @@ A new instance of LyricsEngine
 </div>
 
     <div id="footer">
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 03:20:24 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
-  0.8.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>
 </div>
 
   </body>