<title>
Class: Lyricli::LyricsEngine
- — Documentation by YARD 0.8.1
+ — Documentation by YARD 0.8.2.1
</title>
</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">
- <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>
<span class="summary_desc"><div class='inline'><p>
-A new instance of LyricsEngine.
+Starts a new instance of LyricsEngine.
</p>
</div></span>
</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 class="tag_title">Parameters:</p>
+<ul class="param">
+
+ <li>
+
+ <span class='name'>artist</span>
+
+
+ <span class='type'>(<tt>String</tt>)</span>
+
+
+
+ —
+ <div class='inline'><p>
+the artist
+</p>
+</div>
+
+ </li>
+
+ <li>
+
+ <span class='name'>song</span>
+
+
+ <span class='type'>(<tt>String</tt>)</span>
+
+
+
+ —
+ <div class='inline'><p>
+the song to look for
+</p>
+</div>
+
+ </li>
+</ul>
+
</div><table class="source_code">
<tr>
<pre class="lines">
-6
-7
-8</pre>
+12
+13
+14</pre>
</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'>"</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'>&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'>&fmt=realjson</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<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>
+
+
+
+ —
+ <div class='inline'><p>
+the lyrics
+</p>
+</div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
<tr>
<td>
<pre class="lines">
-10
-11
-12
-13
-14
-15
-16
-17
-18
19
20
21
27
28
29
-30</pre>
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39</pre>
</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='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'>"</span><span class='tstring_content'>.lyricbox</span><span class='tstring_end'>"</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'>"</span><span class='tstring_content'>.rtMatcher</span><span class='tstring_end'>"</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>
</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>
- 0.8.1 (ruby-1.9.2).
+ 0.8.2.1 (ruby-1.9.2).
</div>
</body>